public abstract class ObjectIntMultiVector extends LocalAbstractObject implements BinarySerializable
Modifier and Type | Class and Description |
---|---|
static class |
ObjectIntMultiVector.ArrayMultiWeightProvider
Implementation of
ObjectIntMultiVector.WeightProvider that has a given weight for every
item of every data array of ObjectIntMultiVector . |
static class |
ObjectIntMultiVector.MapMultiWeightProvider
Implementation of
ObjectIntMultiVector.WeightProvider that has a map of weights for
based on items of ObjectIntMultiVector . |
static class |
ObjectIntMultiVector.MultiWeightIgnoreProvider
Implementation of
ObjectIntMultiVector.WeightProvider that has a single weight for every data array of the ObjectIntMultiVector
and it ignores a specified list of integers (created from a given list of keywords) - the ignore weight is specified in the
last weight in the weight array. |
static class |
ObjectIntMultiVector.MultiWeightProvider
Implementation of
ObjectIntMultiVector.WeightProvider that has a single weight for every data array
of the ObjectIntMultiVector . |
static class |
ObjectIntMultiVector.SDIteratorIntersectionResult
Represents resulting values that can be returned by
intersect
method of the ObjectIntMultiVector.SortedDataIterator . |
class |
ObjectIntMultiVector.SortedDataIterator
Internal iterator that provides sorted access to the vector data arrays of integers.
|
static interface |
ObjectIntMultiVector.WeightProvider
Interface for providing the weights for the Jaccard distance function.
|
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected int[][] |
data
Data array
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectIntMultiVector(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectIntVector loaded from binary input buffer.
|
|
ObjectIntMultiVector(java.io.BufferedReader stream)
Creates a new instance of ObjectIntMultiVector from text stream.
|
|
ObjectIntMultiVector(java.io.BufferedReader stream,
int arrays)
Creates a new instance of ObjectIntMultiVector from text stream.
|
|
ObjectIntMultiVector(int[][] data)
Creates a new instance of ObjectIntMultiVector.
|
|
ObjectIntMultiVector(int arrays,
int dimension)
Creates a new instance of ObjectIntMultiVector with randomly generated content data.
|
|
ObjectIntMultiVector(int arrays,
int dimension,
int min,
int max)
Creates a new instance of ObjectIntMultiVector with randomly generated content data.
|
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.
|
int |
getDimensionality()
Returns the number of dimensions of this vector.
|
int |
getSize()
Returns the size of this object in bytes.
|
ObjectIntMultiVector.SortedDataIterator |
getSortedIterator()
Returns an iterator over the integers from all vector data arrays.
|
int[] |
getVectorData()
Returns the vector of all integer values, which represents the contents of all the
respective data array of this object.
|
int[] |
getVectorData(int array)
Returns the vector of integer values, which represents the contents of the
respective data array of this object.
|
int |
getVectorDataCount()
Returns the number of vector data arrays.
|
int |
getVectorDataItem(int array,
int index)
Returns the value at the given
index of the respective data array of this object. |
int |
getVectorDataItemCount(int array)
Returns the number of items in the respective data array of this object.
|
protected void |
sortData()
Sort the internal arrays with data.
|
java.lang.String |
toString()
Converts this object to a string representation.
|
protected void |
writeData(java.io.OutputStream stream)
Store this object's data to a text stream.
|
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 ObjectIntMultiVector(int[][] data)
data
- the data content of the new objectpublic ObjectIntMultiVector(int arrays, int dimension)
arrays
- the number of vector data arrays to createdimension
- number of dimensions to generatepublic ObjectIntMultiVector(int arrays, int dimension, int min, int max)
arrays
- the number of vector data arrays to createdimension
- number of dimensions to generatemin
- lower bound of the random generated values (inclusive)max
- upper bound of the random generated values (exclusive)public ObjectIntMultiVector(java.io.BufferedReader stream, int arrays) throws java.io.EOFException, java.io.IOException, java.lang.NumberFormatException
stream
- the stream from which to read lines of textarrays
- number of arrays to read from the streamjava.io.EOFException
- if the end-of-file of the given stream is reachedjava.io.IOException
- if there was an I/O error during reading from the streamjava.lang.NumberFormatException
- if a line read from the stream does not consist of comma-separated or space-separated numberspublic ObjectIntMultiVector(java.io.BufferedReader stream) throws java.io.EOFException, java.io.IOException, java.lang.NumberFormatException
stream
- the stream from which to read lines of textjava.io.EOFException
- if the end-of-file of the given stream is reachedjava.io.IOException
- if there was an I/O error during reading from the streamjava.lang.NumberFormatException
- if a line read from the stream does not consist of comma-separated or space-separated numbersprotected ObjectIntMultiVector(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the ObjectIntVector 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
LocalAbstractObject
writeData
in class LocalAbstractObject
stream
- the stream to store this object tojava.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 getVectorDataCount()
public int[] getVectorData(int array) throws java.lang.IndexOutOfBoundsException
array
- the index of the array to returnjava.lang.IndexOutOfBoundsException
- if the given array
index is negative or greater or equal to getVectorDataCount()
public int getVectorDataItemCount(int array) throws java.lang.IndexOutOfBoundsException
array
- the index of the array the length of which is returnedjava.lang.IndexOutOfBoundsException
- if the given array
index is negative or greater or equal to getVectorDataCount()
public int getVectorDataItem(int array, int index) throws java.lang.IndexOutOfBoundsException
index
of the respective data array of this object.array
- the index of the array the item of which is returnedindex
- the index of the item in the respective data array to retrievejava.lang.IndexOutOfBoundsException
- if the given array
or index
is negative or
greater or equal to getVectorDataCount()
or getVectorDataItemCount(int)
respectivelypublic int[] getVectorData()
public int getDimensionality()
public int getSize()
LocalAbstractObject
getSize
in class LocalAbstractObject
protected void sortData()
public ObjectIntMultiVector.SortedDataIterator getSortedIterator()
sortData()
.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 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 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