|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.PrecomputedDistancesFilter
messif.objects.PrecomputedDistancesPivotMapFilter
public class PrecomputedDistancesPivotMapFilter
Precomputed distance filter that has the stored precomputed distances mapped
to the respective LocalAbstractObject
.
While filtering, this filter uses one stored distance against the respective
object from the map.
Note that this filter should not be used when the instances of referenced objects
are not in memory. Moreover, this filter cannot be written to text stream, since
the reference objects cannot be correctly resolved. However, a java serialization
or binary serialization
can be used.
Field Summary | |
---|---|
protected java.util.Map<LocalAbstractObject,java.lang.Float> |
precompDistMapping
The hash table of precomputed distances |
Fields inherited from class messif.objects.PrecomputedDistancesFilter |
---|
counterPrecomputedDistanceSavings |
Constructor Summary | |
---|---|
|
PrecomputedDistancesPivotMapFilter()
Creates a new instance of PrecomputedDistancesPivotMapFilter |
protected |
PrecomputedDistancesPivotMapFilter(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of PrecomputedDistancesPivotMapFilter loaded from binary input. |
|
PrecomputedDistancesPivotMapFilter(LocalAbstractObject object)
Creates a new instance of PrecomputedDistancesPivotMapFilter |
Method Summary | |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the output . |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
protected boolean |
excludeUsingPrecompDistImpl(PrecomputedDistancesFilter targetFilter,
float radius)
Returns true if object associated with targetFilter filter can be excluded (filtered out) using this precomputed distances. |
protected boolean |
excludeUsingPrecompDistImpl(PrecomputedDistancesPivotMapFilter targetFilter,
float radius)
Return true if the obj has been filtered out using stored precomputed distance. |
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes. |
int |
getPrecompDistSize()
Returns the number of stored precomputed distances. |
java.util.Set<LocalAbstractObject> |
getPrecompObjects()
Return all objects to which this object has precomputed distances. |
protected float |
getPrecomputedDistanceImpl(LocalAbstractObject obj)
Implement this method to return the precomputed distance to an object. |
protected boolean |
includeUsingPrecompDistImpl(PrecomputedDistancesFilter targetFilter,
float radius)
Returns true if object associated with targetFilter filter can be included using this precomputed distances. |
protected boolean |
includeUsingPrecompDistImpl(PrecomputedDistancesPivotMapFilter targetFilter,
float radius)
Returns true if object associated with targetFilter filter can be included using this precomputed distances. |
protected boolean |
isDataWritable()
Returns whether this filter's data can be written to a text stream. |
boolean |
isGetterSupported()
Returns true if this object supports PrecomputedDistancesFilter.getPrecomputedDistance(messif.objects.LocalAbstractObject) method. |
void |
resetAllPrecompDist()
Removes all precomputed distances. |
boolean |
resetPrecompDist(LocalAbstractObject obj)
Resets the precomputed distance to given object (pivot). |
boolean |
setPrecompDist(LocalAbstractObject obj,
float dist)
Associates a precomputed distance to an object with this object Function appends the new distance 'dist' from the object 'obj' or replaces the old value of distance. |
protected void |
writeData(java.io.OutputStream stream)
Store this filter's data to a text stream. |
Methods inherited from class messif.objects.PrecomputedDistancesFilter |
---|
excludeUsingPrecompDist, getNextFilter, getPrecomputedDistance, includeUsingPrecompDist, write |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Map<LocalAbstractObject,java.lang.Float> precompDistMapping
Constructor Detail |
---|
public PrecomputedDistancesPivotMapFilter()
public PrecomputedDistancesPivotMapFilter(LocalAbstractObject object)
object
- the object to which to add this filterprotected PrecomputedDistancesPivotMapFilter(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the input to read the PrecomputedDistancesPivotMapFilter fromserializator
- the serializator used to write objects
java.io.IOException
- if there was an I/O error reading from the inputMethod Detail |
---|
protected boolean isDataWritable()
PrecomputedDistancesFilter
PrecomputedDistancesFilter.writeData(java.io.OutputStream)
should
provide a valid writing implementation.
isDataWritable
in class PrecomputedDistancesFilter
protected void writeData(java.io.OutputStream stream) throws java.io.IOException
PrecomputedDistancesFilter
writeData
in class PrecomputedDistancesFilter
stream
- the stream to store this object to
java.io.IOException
- if there was an error while writing to streampublic boolean setPrecompDist(LocalAbstractObject obj, float dist)
obj
- the object for which to add distancedist
- the distance to add
public boolean resetPrecompDist(LocalAbstractObject obj)
obj
- Object to which the precomputed distance is stored.
public void resetAllPrecompDist()
public int getPrecompDistSize()
protected final boolean excludeUsingPrecompDistImpl(PrecomputedDistancesFilter targetFilter, float radius)
PrecomputedDistancesFilter
LocalAbstractObject.excludeUsingPrecompDist(messif.objects.LocalAbstractObject, float)
for full explanation.
excludeUsingPrecompDistImpl
in class PrecomputedDistancesFilter
targetFilter
- the target precomputed distancesradius
- the radius to check the precomputed distances for
protected boolean excludeUsingPrecompDistImpl(PrecomputedDistancesPivotMapFilter targetFilter, float radius)
targetFilter
- the target precomputed distancesradius
- the radius to check the precomputed distances for
protected final boolean includeUsingPrecompDistImpl(PrecomputedDistancesFilter targetFilter, float radius)
PrecomputedDistancesFilter
LocalAbstractObject.includeUsingPrecompDist(messif.objects.LocalAbstractObject, float)
for full explanation.
includeUsingPrecompDistImpl
in class PrecomputedDistancesFilter
targetFilter
- the target precomputed distancesradius
- the radius to check the precomputed distances for
protected boolean includeUsingPrecompDistImpl(PrecomputedDistancesPivotMapFilter targetFilter, float radius)
LocalAbstractObject.includeUsingPrecompDist(messif.objects.LocalAbstractObject, float)
for full explanation.
targetFilter
- the target precomputed distancesradius
- the radius to check the precomputed distances for
public boolean isGetterSupported()
PrecomputedDistancesFilter
PrecomputedDistancesFilter.getPrecomputedDistance(messif.objects.LocalAbstractObject)
method.
isGetterSupported
in class PrecomputedDistancesFilter
PrecomputedDistancesFilter.getPrecomputedDistance(messif.objects.LocalAbstractObject)
methodprotected float getPrecomputedDistanceImpl(LocalAbstractObject obj)
PrecomputedDistancesFilter
UNKNOWN_DISTANCE
.
getPrecomputedDistanceImpl
in class PrecomputedDistancesFilter
obj
- the object for which the precomputed distance is returned
public java.util.Set<LocalAbstractObject> getPrecompObjects()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
PrecomputedDistancesFilter
clone
in class PrecomputedDistancesFilter
java.lang.CloneNotSupportedException
- if this object cannot be cloned.public int binarySerialize(BinaryOutput output, BinarySerializator serializator) throws java.io.IOException
output
.
binarySerialize
in interface BinarySerializable
binarySerialize
in class PrecomputedDistancesFilter
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)
getBinarySize
in interface BinarySerializable
getBinarySize
in class PrecomputedDistancesFilter
serializator
- the serializator used to write objects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |