public abstract class ObjectFeatureByte extends ObjectFeature implements BinarySerializable, ObjectVector<java.lang.Short>
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected short[] |
data |
ori, scl, x, y
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectFeatureByte(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectFeatureType loaded from binary input buffer.
|
|
ObjectFeatureByte(java.io.BufferedReader stream)
Creates a new instance of Object from stream.
|
|
ObjectFeatureByte(float x,
float y,
float ori,
float scl,
int dimension)
Creates a new instance of randomly generated object
|
|
ObjectFeatureByte(float x,
float y,
float ori,
float scl,
short[] data)
Creates a new instance of object
|
|
ObjectFeatureByte(short[] data)
Creates a new instance of object
|
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)
Clone randomly
|
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.
|
int |
getDimensionality()
Returns number of dimensions of this vector.
|
int |
getSize()
Returns the size of object in bytes
|
short[] |
getVectorData()
Returns the vector of integers, which represents the contents of this object.
|
int |
getVectorDataDimension()
Number of dimensions of the vector data.
|
java.lang.Short |
getVectorDataItem(int index)
Access to a single datum of vector data at the given zero-based index.
|
java.lang.String |
toString()
toString
Converts the object to a string representation.
|
void |
writeData(java.io.OutputStream stream)
Write object to stream
|
getOrientation, getScale, getX, getY, setOri, setScl, setX, setY
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
public ObjectFeatureByte(float x, float y, float ori, float scl, short[] data)
public ObjectFeatureByte(short[] data)
public ObjectFeatureByte(float x, float y, float ori, float scl, int dimension)
public ObjectFeatureByte(java.io.BufferedReader stream) throws java.io.IOException, java.lang.NumberFormatException
java.io.IOException
java.lang.NumberFormatException
protected ObjectFeatureByte(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
serialVersionUID
= 1 version of this class stored all vector values shifted down by 127 internally. So, the binary serialization
stored these transformed values too. Version 2 does not do such transformation, so binary data must be upgraded somehow ((-:input
- the buffer to read the ObjectFeatureByte fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic short[] getVectorData()
public java.lang.Short getVectorDataItem(int index)
ObjectVector
getVectorDataItem
in interface ObjectVector<java.lang.Short>
index
- zero-base index of the datum to returnpublic int getVectorDataDimension()
ObjectVector
getVectorDataDimension
in interface ObjectVector<java.lang.Short>
public LocalAbstractObject cloneRandomlyModify(java.lang.Object... args) throws java.lang.CloneNotSupportedException
cloneRandomlyModify
in class ObjectFeature
args
- one byte value v that is used to generate modification for each dimension within interval (-v,v).java.lang.CloneNotSupportedException
public void writeData(java.io.OutputStream stream) throws java.io.IOException
writeData
in class ObjectFeature
stream
- the stream to store this object tojava.io.IOException
- if there was an error while writing to streampublic java.lang.String toString()
super.toString()
is appended.toString
in class AbstractObject
public boolean dataEquals(java.lang.Object obj)
LocalAbstractObject
dataEquals
in class ObjectFeature
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 ObjectFeature
public int getSize()
getSize
in class ObjectFeature
public int getDimensionality()
public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
LocalAbstractObject
output
.binarySerialize
in interface BinarySerializable
binarySerialize
in class ObjectFeature
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 ObjectFeature
serializator
- the serializator used to write objects