public class ObjectContourShape extends LocalAbstractObject implements BinarySerializable
Modifier and Type | Class and Description |
---|---|
protected static class |
ObjectContourShape.Node
An auxiliary class used by the distance function.
|
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected byte[] |
globalCurvatureVector |
protected byte[] |
peak |
protected byte[] |
prototypeCurvatureVector |
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectContourShape(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectByteVector loaded from binary input buffer.
|
|
ObjectContourShape(java.io.BufferedReader stream)
Creates a new instance of ObjectContourShape from stream.
|
|
ObjectContourShape(byte[] globalCurvatureVector,
byte[] prototypeCurvatureVector,
byte[] peak)
Creates a new instance of ObjectContourShape
|
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.
|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float distThreshold)
The distance algorithm is taken from the ContourShapeSearch.cpp of the XM library.
|
int |
getSize()
Returns the size of this object in bytes.
|
void |
writeData(java.io.OutputStream stream)
Write object to text stream.
|
clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, 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 final byte[] globalCurvatureVector
protected final byte[] prototypeCurvatureVector
protected final byte[] peak
public ObjectContourShape(byte[] globalCurvatureVector, byte[] prototypeCurvatureVector, byte[] peak)
globalCurvatureVector
- prototypeCurvatureVector
- peak
- public ObjectContourShape(java.io.BufferedReader stream) throws java.io.IOException, java.io.EOFException, java.lang.NumberFormatException, java.lang.IndexOutOfBoundsException
stream
- input stream to read the data fromjava.io.IOException
- when an error appears during reading from given stream.java.io.EOFException
- when end-of-file of the given stream is reached.java.lang.NumberFormatException
- when the line read from given stream does not consist of
comma-separated or space-separated numbers.java.lang.IndexOutOfBoundsException
- when the line is not of this format: protected ObjectContourShape(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectByteVector 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
writeData
in class LocalAbstractObject
stream
- the stream to store this object tojava.io.IOException
- when the output stream throws an exception during the write operationspublic int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
public 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
protected float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
obj
object in this method
and the "query" is this
object.getDistanceImpl
in class LocalAbstractObject
obj
- the object to compute distance todistThreshold
- the threshold value on the distancepublic LocalAbstractObject cloneRandomlyModify(java.lang.Object... args) throws java.lang.CloneNotSupportedException
cloneRandomlyModify
in class LocalAbstractObject
args
- java.lang.CloneNotSupportedException
- when random cloning not supportedpublic 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 objects