public abstract class ObjectFeature extends LocalAbstractObject implements DimensionObjectKey.Point, BinarySerializable
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected float |
ori
Orientation of the gravity vector
|
protected float |
scl
Scale of the gravity vector
|
protected float |
x
x component of spatial coordinates (relative number in the interval [0,1) )
|
protected float |
y
y component of spatial coordinates (relative number in the interval [0,1) )
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
|
ObjectFeature() |
protected |
ObjectFeature(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectFeature loaded from binary input buffer.
|
|
ObjectFeature(java.io.BufferedReader stream)
Expected format:
#key locator
x, y, orientation, scale; key1, key2, key3...
|
|
ObjectFeature(float x,
float y,
float ori,
float scl) |
Modifier and Type | Method and Description |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
LocalAbstractObject |
cloneRandomlyModify(java.lang.Object... args)
Creates and returns a randomly modified copy of this object.
|
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.
|
int |
dataHashCode()
Returns a hash code value for the data of this object.
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
float |
getOrientation()
Returns the Orientation component of the gravity vector
|
float |
getScale()
Returns the Scale component of the gravity vector
|
int |
getSize()
Returns the size of object in bytes
|
float |
getX()
Returns x component of spatial coordinates
|
float |
getY()
Returns Y component of spatial coordinates
|
void |
setOri(float ori) |
void |
setScl(float scl) |
void |
setX(float x) |
void |
setY(float y) |
void |
writeData(java.io.OutputStream stream)
Store this object's data to a text stream.
|
clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceImpl, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getMaxDistance, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, parseObjectComment, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream, writeObjectComment
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey, toString
protected float x
protected float y
protected float ori
protected float scl
public ObjectFeature()
public ObjectFeature(float x, float y, float ori, float scl)
public ObjectFeature(java.io.BufferedReader stream) throws java.io.IOException, java.lang.NumberFormatException
stream
- java.io.IOException
java.lang.NumberFormatException
protected ObjectFeature(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectFeature fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic void writeData(java.io.OutputStream stream) throws java.io.IOException
LocalAbstractObject
writeData
in class LocalAbstractObject
stream
- the stream to store this object tojava.io.IOException
- if there was an error while writing to streampublic boolean dataEquals(java.lang.Object obj)
LocalAbstractObject
dataEquals
in class LocalAbstractObject
obj
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.public int dataHashCode()
LocalAbstractObject
dataHashCode
in class LocalAbstractObject
public int getSize()
getSize
in class LocalAbstractObject
public float getX()
getX
in interface DimensionObjectKey.Point
public float getY()
getY
in interface DimensionObjectKey.Point
public float getScale()
public float getOrientation()
public void setX(float x)
public void setY(float y)
public void setOri(float ori)
public void setScl(float scl)
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.binarySerialize
in interface BinarySerializable
binarySerialize
in class LocalAbstractObject
output
- the output that this object is binary-serialized intoserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error during serializationpublic int getBinarySize(BinarySerializator serializator)
LocalAbstractObject
getBinarySize
in interface BinarySerializable
getBinarySize
in class LocalAbstractObject
serializator
- the serializator used to write objectspublic LocalAbstractObject cloneRandomlyModify(java.lang.Object... args) throws java.lang.CloneNotSupportedException
LocalAbstractObject
cloneRandomlyModify
in class LocalAbstractObject
args
- any parameters required by the subclass implementation - usually two objects with
the minimal and the maximal possible valuesjava.lang.CloneNotSupportedException
- if the object's class does not support cloning or there was an error