public abstract class ObjectFeatureOrderedSet extends ObjectFeatureSet
Modifier and Type | Class and Description |
---|---|
static class |
ObjectFeatureOrderedSet.SlidingWindow
Sliding window -- used in sequence matching of
feature sets . |
LocalAbstractObject.DataEqualObject, LocalAbstractObject.TextStreamFactory<T extends LocalAbstractObject>, LocalAbstractObject.TrivialDistanceFunction
Modifier and Type | Field and Description |
---|---|
protected SortDimension |
sortDim
Current ordering of object features (initially undefined)
|
objects, QUANTIZED_FEATURES_SPLIT_CHARACTER
counterDistanceComputations, counterLowerBoundDistanceComputations, counterPrecomputedDistanceSavings, counterUpperBoundDistanceComputations, MAX_DISTANCE, MIN_DISTANCE, suppData, trivialDistanceFunction, UNKNOWN_DISTANCE
Modifier | Constructor and Description |
---|---|
protected |
ObjectFeatureOrderedSet(BinaryInput input,
BinarySerializator serializator)
Creates a new instance of ObjectFeatureSet loaded from binary input.
|
|
ObjectFeatureOrderedSet(java.io.BufferedReader stream)
Creates a new instance of ObjectFeatureSet from a text stream.
|
|
ObjectFeatureOrderedSet(java.io.BufferedReader stream,
java.util.Map<java.lang.String,? extends java.io.Serializable> additionalParameters)
Creates a new instance of ObjectFeatureSet from a text stream.
|
|
ObjectFeatureOrderedSet(java.lang.String locatorURI,
int width,
int height,
java.util.Collection<? extends ObjectFeature> objects)
Creates a new instance of ObjectFeatureSet for the given locatorURI and encapsulated objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(ObjectFeature obj)
Adds the object to the internal list of objects.
|
int |
binarySerialize(BinaryOutput output,
BinarySerializator serializator)
Binary-serialize this object into the
output . |
int |
getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.
|
int |
getDimension(int dim)
Size of this object in the passed dimension as an absolute value (in pixels).
|
int |
getHeight()
Height of this object in absolute value (height in pixels).
|
SortDimension |
getOrderOfFeatures() |
int |
getWidth()
Width of this object in absolute value (width in pixels).
|
boolean |
isFeaturesOrdered() |
java.util.Iterator<ObjectFeature> |
iterator(int minX,
int maxX,
int minY,
int maxY)
Iterate over all features within the passed window.
|
ResetableIterator<ObjectFeature> |
iterator(SortDimension.Window wnd)
Iterate over all features within the passed window.
|
void |
orderFeatures(SortDimension sortDim) |
protected boolean |
parseObjectComment(java.lang.String line)
Processes a comment line of text representation of the object.
|
protected java.util.Iterator<SortDimension.Window> |
windowIterator(int wndWidth,
int wndHeight,
int shiftX,
int shiftY)
Iterate over all possible positions of the window.
|
java.util.Iterator<SortDimension.Window> |
windowIterator(ObjectFeatureOrderedSet.SlidingWindow slidingWnd)
Iterate over all possible positions of the window.
|
protected void |
writeObjectComment(java.io.OutputStream stream)
Write comment lines of text representation of this object.
|
clearSurplusData, clone, clone, cloneRandomlyModify, containsParameter, dataEquals, dataHashCode, filterFeatures, getObject, getObjectCount, getParameter, getParameter, getParameter, getParameterCount, getParameterMap, getParameterNames, getRequiredParameter, getRequiredParameter, getSaveObjectsClass, getSize, getStringData, iterator, readObject, readObject, toString, writeData
clone, create, create, createMetaDistancesHolder, excludeUsingPrecompDist, getDistance, getDistance, getDistance, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceFilter, getDistanceImpl, getDistanceLowerBound, getDistanceLowerBoundImpl, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceStorePrecomputed, getDistanceUpperBound, getDistanceUpperBoundImpl, getFieldsForNames, getMaxDistance, getNormDistance, getPrecomputedDistance, getPrecomputedDistance, getRandomChar, getRandomNormal, chainDestroy, chainFilter, includeUsingPrecompDist, isDistanceCompatible, peekNextChar, readAttributesFromStream, readObjectComments, readObjectCommentsWithoutData, unchainFilter, write, write, writeAttributesToStream
clone, getLocatorURI, getNoDataObject, getObjectKey, getObjectKey, getObjectLocatorURI, setObjectKey
protected SortDimension sortDim
public ObjectFeatureOrderedSet(java.lang.String locatorURI, int width, int height, java.util.Collection<? extends ObjectFeature> objects)
locatorURI
- the locator URI for the new objectwidth
- x-axis dimensionheight
- y-axis dimensionobjects
- the list of objects to encapsulate in this objectpublic ObjectFeatureOrderedSet(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 ObjectFeatureOrderedSet(java.io.BufferedReader stream, java.util.Map<java.lang.String,? extends java.io.Serializable> additionalParameters) throws java.io.IOException
stream
- the text stream to read an object fromadditionalParameters
- additional parameters for this meta objectjava.io.IOException
- when an error appears during reading from given stream,
EOFException is returned if end of the given stream is reached.protected ObjectFeatureOrderedSet(BinaryInput input, BinarySerializator serializator) throws java.io.IOException
input
- the input to read the ObjectFeatureSet fromserializator
- the serializator used to write objectsjava.io.IOException
- if there was an I/O error reading from the bufferpublic int getWidth()
public int getHeight()
public int getDimension(int dim)
dim
- index of dimensionpublic void addObject(ObjectFeature obj)
addObject
in class ObjectFeatureSet
obj
- object to be addedpublic void orderFeatures(SortDimension sortDim)
public SortDimension getOrderOfFeatures()
public boolean isFeaturesOrdered()
public java.util.Iterator<ObjectFeature> iterator(int minX, int maxX, int minY, int maxY) throws java.lang.IllegalStateException
minX
- minimum in x-axis of the window (absolute value)maxX
- maximum in x-axis of the window (absolute value)minY
- minimum in y-axis of the window (absolute value)maxY
- maximum in y-axis of the window (absolute value)java.lang.IllegalStateException
- is thrown if any sorting dimension has not been set yet.public ResetableIterator<ObjectFeature> iterator(SortDimension.Window wnd) throws java.lang.IllegalStateException
wnd
- window that restricts the features returnedjava.lang.IllegalStateException
- is thrown if any sorting dimension has not been set yet.public java.util.Iterator<SortDimension.Window> windowIterator(ObjectFeatureOrderedSet.SlidingWindow slidingWnd) throws java.lang.IllegalStateException
slidingWnd
- specification window and its shiftsjava.lang.IllegalStateException
- is thrown if any sorting dimension has not been set yet.protected java.util.Iterator<SortDimension.Window> windowIterator(int wndWidth, int wndHeight, int shiftX, int shiftY) throws java.lang.IllegalStateException
wndWidth
- window's width (in pixels -- i.e. absolute value)wndHeight
- window's height (in pixels -- i.e. absolute value)shiftX
- window's shift in x-axis (in pixels -- i.e. absolute value)shiftY
- window's shift in Y-axis (in pixels -- i.e. absolute value)java.lang.IllegalStateException
- is thrown if any sorting dimension has not been set yet.protected boolean parseObjectComment(java.lang.String line) throws java.lang.IllegalArgumentException
LocalAbstractObject
sets the object key
adds a precomputed distances filter
parseObjectComment
in class LocalAbstractObject
line
- a line with commentjava.lang.IllegalArgumentException
- if there was a problem converting the line's comment, e.g. due to invalid formatprotected void writeObjectComment(java.io.OutputStream stream) throws java.io.IOException
LocalAbstractObject
writeObjectComment
in class LocalAbstractObject
stream
- the stream to write the comments 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 ObjectFeatureSet
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 ObjectFeatureSet
serializator
- the serializator used to write objects