|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.UniqueID
messif.objects.AbstractObject
messif.objects.LocalAbstractObject
messif.objects.impl.ObjectShortVector
public abstract class ObjectShortVector
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.objects.LocalAbstractObject |
---|
LocalAbstractObject.DataEqualObject |
Field Summary | |
---|---|
protected short[] |
data
|
Fields inherited from class messif.objects.LocalAbstractObject |
---|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, UNKNOWN_DISTANCE |
Constructor Summary | |
---|---|
protected |
ObjectShortVector(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectShortVector loaded from binary input buffer. |
|
ObjectShortVector(java.io.BufferedReader stream)
Creates a new instance of Object from stream. |
|
ObjectShortVector(int dimension)
Creates a new instance of randomly generated object |
|
ObjectShortVector(short[] data)
Creates a new instance of object |
Method Summary | |
---|---|
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 vector. |
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. |
static short[][] |
getMinMaxForEveryCoord(AbstractObjectIterator<? extends ObjectShortVector> iterator)
Computes minimum and maximum values over every coordinate of vectors in the collection's iterator. |
static short[] |
getMinMaxOverCoords(AbstractObjectIterator<? extends ObjectShortVector> iterator)
Computes minimum and maximum values over all coordinates of vectors in the collection's iterator. |
protected short[] |
getMinMaxOverCoords(short[] currRange)
Computes minimum and maximum values over all coordinates of the current vector. |
int |
getSize()
Returns the size of object in bytes |
short[] |
getVectorData()
Returns the vector of integers, which represents the contents of this object. |
java.lang.String |
toString()
toString Converts the object to a string representation. |
void |
writeData(java.io.OutputStream stream)
Write object to stream |
Methods inherited from class messif.objects.AbstractObject |
---|
clone, getLocatorURI, getNoDataObject, getObjectID, getObjectKey, setObjectKey |
Methods inherited from class messif.objects.UniqueID |
---|
compareTo, equals, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected short[] data
Constructor Detail |
---|
public ObjectShortVector(short[] data)
public ObjectShortVector(int dimension)
public ObjectShortVector(java.io.BufferedReader stream) throws java.io.IOException, java.lang.NumberFormatException
java.io.IOException
java.lang.NumberFormatException
protected ObjectShortVector(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectShortVector fromserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error reading from the bufferMethod Detail |
---|
public short[] getVectorData()
public void writeData(java.io.OutputStream stream) throws java.io.IOException
writeData
in class LocalAbstractObject
stream
- the stream to store this object to
java.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 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 int getDimensionality()
protected short[] getMinMaxOverCoords(short[] currRange)
currRange
- An optional parameter containing current minimum and maximum values. If null is passed
a new range with minimum and maximum is created, otherwise the passed array is updated.
public static short[] getMinMaxOverCoords(AbstractObjectIterator<? extends ObjectShortVector> iterator)
iterator
- Iterator of a collection containing vectors to process.
public static short[][] getMinMaxForEveryCoord(AbstractObjectIterator<? extends ObjectShortVector> iterator)
iterator
- Iterator of a collection containing vectors to process.
public LocalAbstractObject cloneRandomlyModify(java.lang.Object... args) throws java.lang.CloneNotSupportedException
cloneRandomlyModify
in class LocalAbstractObject
args
- expected size of the array is 2: minVector vector with minimal values in all positions
maxVector vector with maximal values in all positions
java.lang.CloneNotSupportedException
- if the object's class does not support clonning or there was an errorpublic int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
output
.
binarySerialize
in interface BinarySerializable
binarySerialize
in class LocalAbstractObject
output
- the data output this object is binary-serialized intoserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error during serializationpublic int getBinarySize(BinarySerializator serializator)
getBinarySize
in interface BinarySerializable
getBinarySize
in class LocalAbstractObject
serializator
- the serializator used to write objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |