messif.objects.impl
Class ObjectByteVectorL1

java.lang.Object
  extended by messif.objects.UniqueID
      extended by messif.objects.AbstractObject
          extended by messif.objects.LocalAbstractObject
              extended by messif.objects.impl.ObjectByteVector
                  extended by messif.objects.impl.ObjectByteVectorL1
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<UniqueID>, BinarySerializable, Clearable

public class ObjectByteVectorL1
extends ObjectByteVector

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class messif.objects.LocalAbstractObject
LocalAbstractObject.DataEqualObject
 
Field Summary
 
Fields inherited from class messif.objects.impl.ObjectByteVector
data
 
Fields inherited from class messif.objects.LocalAbstractObject
counterDistanceComputations, counterLowerBoundDistanceComputations, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, UNKNOWN_DISTANCE
 
Constructor Summary
protected ObjectByteVectorL1(BinaryInput input, BinarySerializator serializator)
          Creates a new instance of ObjectByteVectorL1 loaded from binary input buffer.
  ObjectByteVectorL1(java.io.BufferedReader stream)
          Creates a new instance of object from stream
  ObjectByteVectorL1(byte[] data)
          Creates a new instance of object
  ObjectByteVectorL1(int dimension)
          Creates a new instance of randomly generated object
 
Method Summary
protected  float getDistanceImpl(LocalAbstractObject obj, float distThreshold)
          Metric function Implements city-block distance measure (so-called L1 metric)
 
Methods inherited from class messif.objects.impl.ObjectByteVector
binarySerialize, cloneRandomlyModify, dataEquals, dataHashCode, getBinarySize, getDimensionality, getMinMaxForEveryCoord, getMinMaxOverCoords, getMinMaxOverCoords, getSize, getVectorData, toString, writeData
 
Methods inherited from class messif.objects.LocalAbstractObject
chainDestroy, chainFilter, clearSurplusData, clone, clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceUpperBound, getMaxDistance, getNormDistance, getRandomChar, getRandomNormal, includeUsingPrecompDist, readObjectComments, unchainFilter, write, write
 
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
 

Constructor Detail

ObjectByteVectorL1

public ObjectByteVectorL1(byte[] data)
Creates a new instance of object


ObjectByteVectorL1

public ObjectByteVectorL1(int dimension)
Creates a new instance of randomly generated object


ObjectByteVectorL1

public ObjectByteVectorL1(java.io.BufferedReader stream)
                   throws java.io.IOException,
                          java.lang.NumberFormatException
Creates a new instance of object from stream

Throws:
java.io.IOException
java.lang.NumberFormatException

ObjectByteVectorL1

protected ObjectByteVectorL1(BinaryInput input,
                             BinarySerializator serializator)
                      throws java.io.IOException
Creates a new instance of ObjectByteVectorL1 loaded from binary input buffer.

Parameters:
input - the buffer to read the MetaObjectSAPIRWeightedDist from
serializator - the serializator used to write objects
Throws:
java.io.IOException - if there was an I/O error reading from the buffer
Method Detail

getDistanceImpl

protected float getDistanceImpl(LocalAbstractObject obj,
                                float distThreshold)
Metric function Implements city-block distance measure (so-called L1 metric)

Specified by:
getDistanceImpl in class LocalAbstractObject
Parameters:
obj - the object to compute distance to
distThreshold - the threshold value on the distance
Returns:
the actual distance between obj and this if the distance is lower than distThreshold