public class Feature extends Object implements Point2d, Cloneable
| Modifier and Type | Field and Description |
|---|---|
int |
val
value of feature
|
float |
x
x ordinate of feature
|
float |
y
y ordinate of feature
|
| Constructor and Description |
|---|
Feature() |
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
Feature |
clone() |
Feature |
copy()
Clone the point
|
void |
copyFrom(Point2d p)
Copy the values of the given point into this point.
|
boolean |
equals(Object o) |
int |
getDimensions() |
Float |
getOrdinate(int dimension)
Get the ordinate value for a specific dimension.
|
float |
getX() |
float |
getY() |
int |
hashCode() |
Point2d |
minus(Point2d a)
Take point point from another point such that return = this - a
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
setOrdinate(int dimension,
Number value)
Set the ordinate value for a specific dimension.
|
void |
setX(float x)
Set x coordinate of point
|
void |
setY(float y)
Set y coordinate of point
|
String |
toString() |
String |
toString(String format,
String type)
Convert to string representation with the given format
|
Feature |
transform(Jama.Matrix transform)
Transform the point by the given matrix
|
void |
translate(float x,
float y)
Translate the position of the point by the given amounts
|
void |
translate(Point2d v)
Translate the position of the point by the given amounts
|
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
void |
writeFeatureBin(DataOutputStream os)
Write feature as binary data
|
public float x
public float y
public int val
public Feature()
public String toString(String format, String type)
format - type - public void writeFeatureBin(DataOutputStream os) throws IOException
os - IOExceptionpublic void copyFrom(Point2d p)
Point2dpublic Float getOrdinate(int dimension)
CoordinategetOrdinate in interface Coordinatedimension - The index of the dimension we are interested inpublic int getDimensions()
getDimensions in interface Coordinatepublic void translate(float x, float y)
Point2dpublic Feature transform(Jama.Matrix transform)
Point2dpublic Point2d minus(Point2d a)
Point2dpublic void readASCII(Scanner in) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIin - source to read from.IOException - an error reading inputpublic String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic void readBinary(DataInput in) throws IOException
ReadableBinaryreadBinary in interface ReadableBinaryin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarypublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIout - sink to write toIOException - an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinaryout - sink to write toIOException - an error writing to outpublic void translate(Point2d v)
Point2dpublic void setOrdinate(int dimension, Number value)
CoordinatesetOrdinate in interface Coordinatedimension - The index of the dimension we are interested invalue - The value of the ordinate of the given dimension.