public class MetaObjectPixMacShapeAndColor extends MetaObject implements BinarySerializable
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected ObjectColorLayout |
colorLayout
Object for the ColorLayoutType
|
protected ObjectShortVectorL1 |
colorStructure
Object for the ColorStructureType
|
protected static java.lang.String[] |
descriptorNames
The list of the names for the encapsulated objects
|
protected ObjectVectorEdgecomp |
edgeHistogram
Object for the EdgeHistogramType
|
protected ObjectIntSortedVectorJaccard |
keyWords
Object for the KeyWordsType
|
protected ObjectRegionShape |
regionShape
Object for the RegionShapeType
|
protected ObjectIntVectorL1 |
scalableColor
Object for the ScalableColorType
|
protected static java.lang.String[] |
textStreamDescriptorNames
The list of the names for the encapsulated objects - without the KeyWordsType, because it's not in the text stream by default.
|
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
MetaObjectPixMacShapeAndColor(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of MetaObjectPixMacShapeAndColor loaded from binary input buffer.
|
|
MetaObjectPixMacShapeAndColor(java.io.BufferedReader stream)
Creates a new instance of MetaObjectPixMacShapeAndColor.
|
|
MetaObjectPixMacShapeAndColor(java.io.BufferedReader stream,
boolean haveKeyWords,
boolean readKeyWords)
Creates a new instance of MetaObjectPixMacShapeAndColor from the given text stream.
|
|
MetaObjectPixMacShapeAndColor(java.io.BufferedReader stream,
IntStorageIndexed<java.lang.String> keyWordIndex)
Creates a new instance of MetaObjectPixMacShapeAndColor.
|
|
MetaObjectPixMacShapeAndColor(MetaObject object)
Creates a new instance of MetaObjectPixMacShapeAndColor from the given
MetaObject . |
|
MetaObjectPixMacShapeAndColor(MetaObject object,
IntStorageIndexed<java.lang.String> keyWordIndex,
java.lang.String... keyWords)
Creates a new instance of MetaObjectPixMacShapeAndColor from the given
MetaObject
and given set of keywords. |
|
MetaObjectPixMacShapeAndColor(java.lang.String locatorURI,
java.util.Map<java.lang.String,? extends LocalAbstractObject> objects)
Creates a new instance of MetaObjectPixMacShapeAndColor from the given key and encapsulated objects.
|
|
MetaObjectPixMacShapeAndColor(java.lang.String locatorURI,
java.util.Map<java.lang.String,LocalAbstractObject> objects,
boolean cloneObjects)
Creates a new instance of MetaObjectPixMacShapeAndColor from the given key and encapsulated objects.
|
|
MetaObjectPixMacShapeAndColor(java.lang.String locatorURI,
ObjectColorLayout colorLayout,
ObjectShortVectorL1 colorStructure,
ObjectVectorEdgecomp edgeHistogram,
ObjectIntVectorL1 scalableColor,
ObjectRegionShape regionShape,
ObjectIntSortedVectorJaccard keyWords)
Creates a new instance of MetaObjectPixMacShapeAndColor from the given key 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.
|
boolean |
dataEquals(java.lang.Object obj)
Indicates whether some other object has the same data as this one.
|
int |
dataHashCode()
Returns sum of hash code values for all the encapsulated objects' data.
|
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.
|
ObjectIntSortedVectorJaccard |
getKeyWords()
Returns the object that encapsulates the keywords for this metaobject.
|
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 for the respective
descriptors
that are used in the distance function. |
protected void |
writeData(java.io.OutputStream stream)
Store this object to a text stream.
|
clearSurplusData, containsObject, createMetaDistancesHolder, createSearchMetaObject, 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 java.lang.String[] textStreamDescriptorNames
protected ObjectColorLayout colorLayout
protected ObjectShortVectorL1 colorStructure
protected ObjectVectorEdgecomp edgeHistogram
protected ObjectIntVectorL1 scalableColor
protected ObjectRegionShape regionShape
protected ObjectIntSortedVectorJaccard keyWords
public MetaObjectPixMacShapeAndColor(java.lang.String locatorURI, ObjectColorLayout colorLayout, ObjectShortVectorL1 colorStructure, ObjectVectorEdgecomp edgeHistogram, ObjectIntVectorL1 scalableColor, ObjectRegionShape regionShape, ObjectIntSortedVectorJaccard keyWords)
locatorURI
- locator of the metaobject (and typically all of the passed objects)colorLayout
- color layout descriptorcolorStructure
- color structure descriptoredgeHistogram
- edge histogram descriptorscalableColor
- scalable color descriptorregionShape
- region shape descriptorkeyWords
- key words descriptorpublic MetaObjectPixMacShapeAndColor(java.lang.String locatorURI, java.util.Map<java.lang.String,LocalAbstractObject> objects, boolean cloneObjects) throws java.lang.CloneNotSupportedException
locatorURI
- locator of the metaobject (and typically all of the passed objects)objects
- map of objects with the descriptorNames
as keyscloneObjects
- if true, the cloned
objects from the map will be stored in this metaobjectjava.lang.CloneNotSupportedException
- if there was a problem cloning an object from the mappublic MetaObjectPixMacShapeAndColor(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
- map of objects with the descriptorNames
as keyspublic MetaObjectPixMacShapeAndColor(MetaObject object)
MetaObject
.
The locator and the encapsulated objects from the source object
are
taken.object
- the source metaobject from which to get the datapublic MetaObjectPixMacShapeAndColor(MetaObject object, IntStorageIndexed<java.lang.String> keyWordIndex, java.lang.String... keyWords)
MetaObject
and given set of keywords. The locator and the encapsulated objects from the source
object
are taken.object
- the source metaobject from which to get the datakeyWordIndex
- the index for translating keywords to addresseskeyWords
- the keywords to set for the new objectpublic MetaObjectPixMacShapeAndColor(java.io.BufferedReader stream, boolean haveKeyWords, boolean readKeyWords) throws java.io.IOException
LocalAbstractObject
is loaded.stream
- the stream from which the data are readhaveKeyWords
- flag whether the data contains keyWordsreadKeyWords
- flag whether to read the keyWords (true) or
skip the keywords line (false)java.io.IOException
- if there was an error reading the data from the streampublic MetaObjectPixMacShapeAndColor(java.io.BufferedReader stream) throws java.io.IOException
stream
- stream to read the data fromjava.io.IOException
- if reading from the stream failspublic MetaObjectPixMacShapeAndColor(java.io.BufferedReader stream, IntStorageIndexed<java.lang.String> keyWordIndex) throws java.io.IOException
stream
- stream to read the data fromkeyWordIndex
- the index for translating keywords to addressesjava.io.IOException
- if reading from the stream failsprotected MetaObjectPixMacShapeAndColor(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the buffer to read the MetaObjectPixMacShapeAndColor 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 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
public ObjectIntSortedVectorJaccard getKeyWords()
public int dataHashCode()
MetaObject
dataHashCode
in class MetaObject
public boolean dataEquals(java.lang.Object obj)
MetaObject
dataEquals
in class MetaObject
obj
- the reference object with which to compare (if it is not MetaObject, this method will return false
)true
if this object is the same as the obj
argument; false
otherwise.protected 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 static float[] getWeights()
descriptors
that are used in the distance function.public float getMaxDistance()
LocalAbstractObject
LocalAbstractObject.MAX_DISTANCE
.getMaxDistance
in class LocalAbstractObject
public LocalAbstractObject clone(boolean cloneFilterChain) throws java.lang.CloneNotSupportedException
clone
in class LocalAbstractObject
cloneFilterChain
- the flag whether the filter chain must be cloned as well.java.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 errorprotected void writeData(java.io.OutputStream stream) throws java.io.IOException
writeData
in class LocalAbstractObject
stream
- the stream to store this object tojava.io.IOException
- if there was an error while writing to streampublic 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