public class MetaObjectFixedMap extends MetaObject
MetaObject
which stores data in fixed ArrayMap
.LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected DistanceFunction<MetaObject> |
distance
A distance function (can be null).
|
protected ArrayMap<java.lang.String,LocalAbstractObject> |
objects
Map to store the data in.
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
MetaObjectFixedMap(ArrayMap<java.lang.String,LocalAbstractObject> objects,
java.lang.String locatorURI)
Create this meta object by directly using given map.
|
protected |
MetaObjectFixedMap(ArrayMap<java.lang.String,LocalAbstractObject> objects,
java.lang.String locatorURI,
DistanceFunction<MetaObject> distance)
Create this meta object by directly using given map.
|
|
MetaObjectFixedMap(java.io.BufferedReader stream)
Creates a new instance of MetaObjectMap from a text stream.
|
|
MetaObjectFixedMap(java.io.BufferedReader stream,
java.util.Set<java.lang.String> restrictNames)
Creates a new instance of MetaObjectMap from a text stream.
|
|
MetaObjectFixedMap(java.io.BufferedReader stream,
java.lang.String[] restrictNames)
Creates a new instance of MetaObjectMap from a text stream.
|
|
MetaObjectFixedMap(java.util.Map<java.lang.String,LocalAbstractObject> objects,
AbstractObjectKey objectKey)
Create this meta object by (shallow) copying of data in given map.
|
|
MetaObjectFixedMap(java.util.Map<java.lang.String,LocalAbstractObject> objects,
AbstractObjectKey objectKey,
DistanceFunction<MetaObject> distance)
Create this meta object by (shallow) copying of data in given map.
|
|
MetaObjectFixedMap(java.util.Map<java.lang.String,LocalAbstractObject> objects,
java.lang.String locatorURI)
Create this meta object by (shallow) copying of data in given map.
|
|
MetaObjectFixedMap(java.lang.String[] keys,
LocalAbstractObject[] values,
java.lang.String locatorURI)
Create this meta object by (shallow) copying of data in given arrays.
|
|
MetaObjectFixedMap(java.lang.String key,
LocalAbstractObject value,
java.lang.String locatorURI)
Create this meta object from one key and value.
|
|
MetaObjectFixedMap(java.lang.String key,
LocalAbstractObject value,
java.lang.String locatorURI,
DistanceFunction<MetaObject> distance)
Create this meta object from one key and value and distance.
|
Modifier and Type | Method and Description |
---|---|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float[] metaDistances,
float distThreshold)
The actual implementation of the metric function.
|
LocalAbstractObject |
getObject(java.lang.String name)
Returns the encapsulated object for given symbolic name.
|
int |
getObjectCount()
Returns the number of encapsulated objects.
|
java.util.Collection<java.lang.String> |
getObjectNames()
Returns a set of symbolic names of the encapsulated objects.
|
void |
setDistance(DistanceFunction<MetaObject> distance) |
protected void |
writeData(java.io.OutputStream stream)
Store this object's data to a text stream.
|
clearSurplusData, containsObject, createMetaDistancesHolder, createSearchMetaObject, dataEquals, dataHashCode, fillMetaDistances, fillMetaDistances, getDistanceImpl, getObjectFromMap, getObjectMap, getObjects, getSize, implementationGetDistance, readObject, readObject, readObjects, readObjects, readObjectsHeader, toString, writeObjects, writeObjectsHeader
binarySerialize, clone, clone, cloneRandomlyModify, create, create, excludeUsingPrecompDist, getBinarySize, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, 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
protected final ArrayMap<java.lang.String,LocalAbstractObject> objects
protected DistanceFunction<MetaObject> distance
public MetaObjectFixedMap(java.util.Map<java.lang.String,LocalAbstractObject> objects, AbstractObjectKey objectKey, DistanceFunction<MetaObject> distance)
objects
- map to copy the object fromobjectKey
- object keydistance
- distance function to be used by this object (can be null)protected MetaObjectFixedMap(ArrayMap<java.lang.String,LocalAbstractObject> objects, java.lang.String locatorURI, DistanceFunction<MetaObject> distance)
objects
- map of objects (directly used)locatorURI
- locatordistance
- distance function to be used by this object (can be null)public MetaObjectFixedMap(java.util.Map<java.lang.String,LocalAbstractObject> objects, AbstractObjectKey objectKey)
objects
- map to copy the object fromobjectKey
- object keypublic MetaObjectFixedMap(java.util.Map<java.lang.String,LocalAbstractObject> objects, java.lang.String locatorURI)
objects
- map to copy the object fromlocatorURI
- locatorpublic MetaObjectFixedMap(java.lang.String[] keys, LocalAbstractObject[] values, java.lang.String locatorURI)
keys
- list of string keysvalues
- list of LocalAbstractObject
slocatorURI
- locatorpublic MetaObjectFixedMap(java.lang.String key, LocalAbstractObject value, java.lang.String locatorURI)
key
- string keyvalue
- LocalAbstractObject
valuelocatorURI
- locatorpublic MetaObjectFixedMap(java.lang.String key, LocalAbstractObject value, java.lang.String locatorURI, DistanceFunction<MetaObject> distance)
key
- string keyvalue
- LocalAbstractObject
valuelocatorURI
- locatordistance
- distance function to be used by this object (can be null)protected MetaObjectFixedMap(ArrayMap<java.lang.String,LocalAbstractObject> objects, java.lang.String locatorURI)
objects
- map of objects (directly used)locatorURI
- locatorpublic MetaObjectFixedMap(java.io.BufferedReader stream, java.util.Set<java.lang.String> restrictNames) throws java.io.IOException
restrictNames
are added.stream
- the text stream to read an object fromrestrictNames
- if not null only the names specified in this collection are added to the objects tablejava.io.IOException
- when an error appears during reading from given stream,
EOFException is returned if end of the given stream is reached.public MetaObjectFixedMap(java.io.BufferedReader stream, java.lang.String[] restrictNames) throws java.io.IOException
restrictNames
are added.stream
- the text stream to read an object fromrestrictNames
- if not null only the names specified in this collection are added to the objects tablejava.io.IOException
- when an error appears during reading from given stream,
EOFException is returned if end of the given stream is reached.public MetaObjectFixedMap(java.io.BufferedReader stream) throws java.io.IOException
stream
- the text stream to read an object fromjava.io.IOException
- when an error appears during reading from given stream,
EOFException is returned if end of the given stream is reached.public void setDistance(DistanceFunction<MetaObject> distance)
public int getObjectCount()
MetaObject
getObjectCount
in class MetaObject
public java.util.Collection<java.lang.String> getObjectNames()
MetaObject
getObjectNames
in class MetaObject
public LocalAbstractObject getObject(java.lang.String name)
MetaObject
getObject
in class MetaObject
name
- the symbolic name of the object to returnprotected float getDistanceImpl(LocalAbstractObject obj, float[] metaDistances, float distThreshold)
MetaObject
metaDistances
parameter is not null, it should be filled
with the distances to the respective encapsulated objects (method
fillMetaDistances
can be used).getDistanceImpl
in class MetaObject
obj
- the object to compute distance tometaDistances
- the array that is filled with the distances of the respective encapsulated objects, if it is not nulldistThreshold
- the threshold value on the distanceLocalAbstractObject.getDistance(messif.objects.LocalAbstractObject)
protected 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 stream