|
||||||||||
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.ObjectIntVector
public abstract class ObjectIntVector
This object uses static array of integers as its data content.
No implementation of distance function is provided - see ObjectIntVectorL1
or ObjectIntVectorL2
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.objects.LocalAbstractObject |
---|
LocalAbstractObject.DataEqualObject |
Field Summary | |
---|---|
protected int[] |
data
Data array |
Fields inherited from class messif.objects.LocalAbstractObject |
---|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, UNKNOWN_DISTANCE |
Constructor Summary | |
---|---|
protected |
ObjectIntVector(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectIntVector loaded from binary input buffer. |
|
ObjectIntVector(java.io.BufferedReader stream)
Creates a new instance of ObjectFloatVector from text stream. |
|
ObjectIntVector(int dimension)
Creates a new instance of ObjectIntVector with randomly generated content data. |
|
ObjectIntVector(int[] data)
Creates a new instance of ObjectIntVector. |
|
ObjectIntVector(int dimension,
int min,
int max)
Creates a new instance of ObjectIntVector with randomly generated content data. |
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 the number of dimensions of this vector. |
static int[][] |
getMinMaxForEveryCoord(AbstractObjectIterator<? extends ObjectIntVector> iterator)
Computes minimum and maximum values over every coordinate of vectors in the collection's iterator. |
static int[] |
getMinMaxOverCoords(AbstractObjectIterator<? extends ObjectIntVector> iterator)
Computes minimum and maximum values over all coordinates of vectors in the collection's iterator. |
protected int[] |
getMinMaxOverCoords(int[] currRange)
Computes minimum and maximum values over all coordinates of the current vector. |
int |
getSize()
Returns the size of this object in bytes. |
int[] |
getVectorData()
Returns the vector of float values, which represents the contents of this object. |
java.lang.String |
toString()
Converts this object to a string representation. |
void |
writeData(java.io.OutputStream stream)
Store this object's data to a text 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 int[] data
Constructor Detail |
---|
public ObjectIntVector(int[] data)
data
- the data content of the new objectpublic ObjectIntVector(int dimension)
dimension
- number of dimensions to generatepublic ObjectIntVector(int dimension, int min, int max)
dimension
- number of dimensions to generatemin
- lower bound of the random generated values (inclusive)max
- upper bound of the random generated values (exclusive)public ObjectIntVector(java.io.BufferedReader stream) throws java.io.EOFException, java.io.IOException, java.lang.NumberFormatException
stream
- the stream from which to read lines of text
java.io.EOFException
- if the end-of-file of the given stream is reached
java.io.IOException
- if there was an I/O error during reading from the stream
java.lang.NumberFormatException
- if a line read from the stream does not consist of comma-separated or space-separated numbersprotected ObjectIntVector(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectIntVector fromserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error reading from the bufferMethod Detail |
---|
public void writeData(java.io.OutputStream stream) throws java.io.IOException
LocalAbstractObject
writeData
in class LocalAbstractObject
stream
- the stream to store this object to
java.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[] getVectorData()
public int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
public int getDimensionality()
protected int[] getMinMaxOverCoords(int[] 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 int[] getMinMaxOverCoords(AbstractObjectIterator<? extends ObjectIntVector> iterator)
iterator
- Iterator of a collection containing vectors to process.
public static int[][] getMinMaxForEveryCoord(AbstractObjectIterator<? extends ObjectIntVector> 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 java.lang.String toString()
super.toString()
is appended.
toString
in class AbstractObject
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 objects
java.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |