public class MetaObjectShape extends MetaObject implements BinarySerializable
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String[] |
descriptorNames
The list of the names for the encapsulated objects
|
protected static float[] |
descriptorWeights
Descriptor weights used to compute the overall distance
|
protected ObjectVectorEdgecomp |
edgeHistogram
Object for the EdgeHistogramType
|
protected ObjectXMRegionShape |
regionShape
Object for the RegionShapeType
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
MetaObjectShape(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of MetaObjectShape loaded from binary input buffer.
|
|
MetaObjectShape(java.io.BufferedReader stream)
Creates a new instance of MetaObjectShape from a text stream.
|
|
MetaObjectShape(java.io.BufferedReader stream,
java.util.Set<java.lang.String> restrictNames)
Creates a new instance of MetaObjectShape from a text stream.
|
|
MetaObjectShape(java.io.BufferedReader stream,
java.lang.String[] restrictNames)
Creates a new instance of MetaObjectShape from a text stream.
|
|
MetaObjectShape(MetaObject object)
Creates a new instance of MetaObjectShape by taking objects from another
MetaObject . |
|
MetaObjectShape(java.lang.String locatorURI,
java.util.Map<java.lang.String,? extends LocalAbstractObject> objects)
Creates a new instance of MetaObjectShape from the given map of objects.
|
|
MetaObjectShape(java.lang.String locatorURI,
java.util.Map<java.lang.String,LocalAbstractObject> objects,
boolean cloneObjects)
Creates a new instance of MetaObjectShape with the given locator and encapsulated objects.
|
|
MetaObjectShape(java.lang.String locatorURI,
ObjectVectorEdgecomp edgeHistogram,
ObjectXMRegionShape regionShape)
Creates a new instance of MetaObjectShape with the given locator and encapsulated objects.
|
Modifier and Type | Method and Description |
---|---|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
LocalAbstractObject |
clone(boolean cloneFilterChain)
Creates and returns a copy of this object.
|
LocalAbstractObject |
cloneRandomlyModify(java.lang.Object... args)
Creates and returns a randomly modified copy of this object.
|
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
protected float |
getDistanceImpl(LocalAbstractObject obj,
float[] metaDistances,
float distThreshold)
The actual implementation of the metric function.
|
float |
getMaxDistance()
Returns a maximal possible distance for this class.
|
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.
|
java.util.Collection<LocalAbstractObject> |
getObjects()
Returns a collection of all the encapsulated objects.
|
static java.lang.String[] |
getSupportedVisualDescriptorTypes()
Returns list of supported visual descriptor types that this object recognizes in XML.
|
static float[] |
getWeights()
Returns the weights used to compute the overall 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, getSize, implementationGetDistance, readObject, readObject, readObjects, readObjects, readObjectsHeader, toString, writeObjects, writeObjectsHeader
clone, create, create, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, 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 static final java.lang.String[] descriptorNames
protected static final float[] descriptorWeights
protected ObjectVectorEdgecomp edgeHistogram
protected ObjectXMRegionShape regionShape
public MetaObjectShape(java.lang.String locatorURI, ObjectVectorEdgecomp edgeHistogram, ObjectXMRegionShape regionShape)
locatorURI
- locator of the metaobject (and typically all of the passed objects)edgeHistogram
- edge histogram descriptorregionShape
- region shape descriptorpublic MetaObjectShape(java.lang.String locatorURI, java.util.Map<java.lang.String,LocalAbstractObject> objects, boolean cloneObjects) throws java.lang.CloneNotSupportedException
cloneObjects
is requested.locatorURI
- locator of the metaobject (and typically all of the passed objects)objects
- the map of encapsulated objectscloneObjects
- flag whether to clone (true) the encapsulated objects or
use the instances from the objects map directly (false)java.lang.CloneNotSupportedException
- if there was a problem cloning the objects from the mappublic MetaObjectShape(java.lang.String locatorURI, java.util.Map<java.lang.String,? extends LocalAbstractObject> objects)
locatorURI
- locator of the metaobject (and typically all of the passed objects)objects
- a map of named objects from which to get the internal objects of the MetaObjectShapeAndColorpublic MetaObjectShape(MetaObject object)
MetaObject
.
Note that the objects are not cloned.object
- the meta object from which this one is createdpublic MetaObjectShape(java.io.BufferedReader stream, java.util.Set<java.lang.String> restrictNames) throws java.io.IOException
stream
- the text stream to read the data fromrestrictNames
- the sub-distances may be restricted by passing list of sub-dist namesjava.io.IOException
- if reading from the stream failspublic MetaObjectShape(java.io.BufferedReader stream, java.lang.String[] restrictNames) throws java.io.IOException
stream
- the text stream to read the data fromrestrictNames
- the sub-distances may be restricted by passing list of sub-dist namesjava.io.IOException
- if reading from the stream failspublic MetaObjectShape(java.io.BufferedReader stream) throws java.io.IOException
stream
- the text stream to read the data fromjava.io.IOException
- if reading from the stream failsprotected MetaObjectShape(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the MetaObjectShapeAndColor fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic static java.lang.String[] getSupportedVisualDescriptorTypes()
public static float[] getWeights()
public int getObjectCount()
getObjectCount
in class MetaObject
public LocalAbstractObject getObject(java.lang.String name)
getObject
in class MetaObject
name
- the symbolic name of the object to returnpublic java.util.Collection<LocalAbstractObject> getObjects()
MetaObject
getObjects
in class MetaObject
public java.util.Collection<java.lang.String> getObjectNames()
MetaObject
getObjectNames
in class MetaObject
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 streamprotected 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)
public float getMaxDistance()
LocalAbstractObject
LocalAbstractObject.MAX_DISTANCE
.getMaxDistance
in class LocalAbstractObject
public LocalAbstractObject clone(boolean cloneFilterChain) throws java.lang.CloneNotSupportedException
LocalAbstractObject
clone
in class LocalAbstractObject
cloneFilterChain
- the flag whether the filter chain should be cloned as welljava.lang.CloneNotSupportedException
- if the object's class does not support cloning or there was an errorpublic 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 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