public class SpatialLocation extends Point2dImpl implements Location, Cloneable
Location
in 2d-space. SpatialLocations
contain x and y ordinates.x, y
Constructor and Description |
---|
SpatialLocation()
Construct the ScaleSpaceLocation at 0, 0.
|
SpatialLocation(float x,
float y)
Construct the SpatialLocation with the given x and y coordinates.
|
Modifier and Type | Method and Description |
---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
SpatialLocation |
clone() |
int |
getDimensions() |
Float |
getOrdinate(int dimension)
Get the ordinate value for a specific dimension.
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
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.
|
copy, copyFrom, createRandomPoint, createRandomPoint, equals, fromDoubleArray, getX, getY, hashCode, minus, setOrdinate, setX, setY, toString, transform, translate, translate
finalize, getClass, notify, notifyAll, wait, wait, wait
setOrdinate
public SpatialLocation()
public SpatialLocation(float x, float y)
x
- the x-coordinatey
- the y-coordinatepublic void writeBinary(DataOutput out) throws IOException
WriteableBinary
writeBinary
in interface WriteableBinary
writeBinary
in class Point2dImpl
out
- sink to write toIOException
- an error writing to outpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
writeASCII
in class Point2dImpl
out
- sink to write toIOException
- an error writing to outpublic void readBinary(DataInput in) throws IOException
ReadableBinary
readBinary
in interface ReadableBinary
readBinary
in class Point2dImpl
in
- source to read from.IOException
- an error reading inputpublic void readASCII(Scanner in) throws IOException
ReadableASCII
readASCII
in interface ReadableASCII
readASCII
in class Point2dImpl
in
- source to read from.IOException
- an error reading inputpublic byte[] binaryHeader()
ReadableBinary
binaryHeader
in interface ReadableBinary
binaryHeader
in interface WriteableBinary
binaryHeader
in class Point2dImpl
public String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
asciiHeader
in class Point2dImpl
public Float getOrdinate(int dimension)
Coordinate
getOrdinate
in interface Coordinate
getOrdinate
in class Point2dImpl
dimension
- The index of the dimension we are interested inpublic int getDimensions()
getDimensions
in interface Coordinate
getDimensions
in class Point2dImpl
public SpatialLocation clone()
clone
in class Point2dImpl