public class ObjectRegionShape extends LocalAbstractObject implements BinarySerializable
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected static int |
ART_ANGULAR |
protected static int |
ART_RADIAL |
protected static double[] |
iQuantTable |
protected static double[] |
quantTable
Coefficients
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
|
ObjectRegionShape()
Initialize all coefficients to "0".
|
protected |
ObjectRegionShape(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectRegionShape loaded from binary input buffer.
|
|
ObjectRegionShape(java.io.BufferedReader stream)
Read the object from the text file representation: single-dimentional array of bytes.
|
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 actual implementation of the metric function (see
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject) for full explanation). |
byte |
getElement(int p,
int r)
Get element from the array - index to the quantization arrays.
|
double |
getRealValue(int p,
int r)
Get element from the array value from the quantization array
|
int |
getSize()
Returns the size of this object in bytes.
|
protected void |
writeData(java.io.OutputStream stream)
Write to the text file as a single-dimensional array
|
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 static double[] quantTable
protected static double[] iQuantTable
protected static int ART_ANGULAR
protected static int ART_RADIAL
public ObjectRegionShape()
public ObjectRegionShape(java.io.BufferedReader stream) throws java.io.IOException, java.lang.NumberFormatException
stream
- input stremjava.io.IOException
- if reading from the stream goes wrongjava.lang.NumberFormatException
- if any of the number is not a numberprotected ObjectRegionShape(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 bufferprotected void writeData(java.io.OutputStream stream) throws java.io.IOException
writeData
in class LocalAbstractObject
stream
- the stream to write the data tojava.io.IOException
- if writing to the stream goes wrongpublic byte getElement(int p, int r)
p
- index1r
- index2public double getRealValue(int p, int r)
p
- index1r
- index2protected float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
LocalAbstractObject
LocalAbstractObject.getDistance(messif.objects.LocalAbstractObject)
for full explanation).
The implementation should not increment distanceComputations statistics.getDistanceImpl
in class LocalAbstractObject
obj
- the object to compute distance todistThreshold
- the threshold value on the distancepublic 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 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 errorpublic int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
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 objects