Package org.apache.uima.cas.impl
Class FSLeafIndexImpl<T extends FeatureStructure>
java.lang.Object
org.apache.uima.cas.impl.FSLeafIndexImpl<T>
- Type Parameters:
T
- the Java cover class type for this index, passed along to (wrapped) iterators producing Java cover classes
- All Implemented Interfaces:
Comparator<T>
,FSIndexImpl
,LowLevelIndex
,IntComparator
- Direct Known Subclasses:
FSBagIndex
,FSIntArrayIndex
,FSRBTSetIndex
public abstract class FSLeafIndexImpl<T extends FeatureStructure>
extends Object
implements Comparator<T>, IntComparator, FSIndexImpl
The common (among all index kinds - set, sorted, bag) info for an index
Subtypes define the actual index repository (integers indexing the CAS) for each kind.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private FSIndexComparatorImpl
private static final int
private static final int
private final int
private static final int
private boolean
private int[]
private int[]
private int[]
private static final int
protected final CASImpl
private int
private static final int
private static final int
private final Type
private static final int
private final int
private LinearTypeOrder[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
protected
FSLeafIndexImpl
(CASImpl cas, Type type, int indexType) Constructor for FSLeafIndexImpl. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
For serialization: get all the items in this index and bulk add to an IntVectorint
compare
(int fs1, int fs2) Note: may return other than -1 , 0, and 1 (e.g., might return -6)int
compare
(FeatureStructure fs1, FeatureStructure fs2) abstract void
Method deleteFS.boolean
private final int
getFeatureOffset
(Feature feat) int
(package private) IntComparator
private static final int
getKeyCode
(Feature feat) getType()
(package private) int
int
hashCode()
(package private) boolean
init
(FSIndexComparator comp) (package private) abstract boolean
insert
(int fs) (package private) abstract boolean
insert
(int fs, int count) int
ll_compare
(int fs1, int fs2) Note: may return other than -1 , 0, and 1 (e.g., might return -6)ll_iterator
(boolean ambiguous) Get a low-level, FS reference iterator.Get a low-level, FS reference iterator specifying instances of the precise type only (i.e.abstract ComparableIntPointerIterator<T>
pointerIterator
(IntComparator comp, int[] detectIllegalIndexUpdates, int typeCode) protected abstract IntPointerIterator
protected abstract IntPointerIterator
refIterator
(int fsCode) (package private) abstract boolean
remove
(int fs) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Methods inherited from interface org.apache.uima.cas.impl.FSIndexImpl
flush
Methods inherited from interface org.apache.uima.cas.impl.LowLevelIndex
ll_iterator, size
-
Field Details
-
indexType
private final int indexType -
lowLevelCAS
-
STRING_CODE
private static final int STRING_CODE- See Also:
-
FLOAT_CODE
private static final int FLOAT_CODE- See Also:
-
INT_CODE
private static final int INT_CODE- See Also:
-
TYPE_ORDER_CODE
private static final int TYPE_ORDER_CODE- See Also:
-
BOOLEAN_CODE
private static final int BOOLEAN_CODE- See Also:
-
BYTE_CODE
private static final int BYTE_CODE- See Also:
-
SHORT_CODE
private static final int SHORT_CODE- See Also:
-
LONG_CODE
private static final int LONG_CODE- See Also:
-
DOUBLE_CODE
private static final int DOUBLE_CODE- See Also:
-
comparator
-
isInitialized
private boolean isInitialized -
keyType
private int[] keyType -
keyOffset
private int[] keyOffset -
typeOrder
-
keyComp
private int[] keyComp -
numKeys
private int numKeys -
type
-
typeCode
private final int typeCode
-
-
Constructor Details
-
FSLeafIndexImpl
private FSLeafIndexImpl() -
FSLeafIndexImpl
Constructor for FSLeafIndexImpl.- Parameters:
cas
- -type
- -indexType
- -
-
-
Method Details
-
toString
-
insert
abstract boolean insert(int fs) -
insert
abstract boolean insert(int fs, int count) -
remove
abstract boolean remove(int fs) - Parameters:
fs
- - the Feature Structure to be removed. Only this exact Feature Structure is removed (this is a stronger test than, for example, what moveTo(fs) does, where the fs in that case is used as a template). It is not an error if this exact Feature Structure is not in an index.- Returns:
- true if something was removed, false if not found
-
pointerIterator
public abstract ComparableIntPointerIterator<T> pointerIterator(IntComparator comp, int[] detectIllegalIndexUpdates, int typeCode) -
getComparator
- Specified by:
getComparator
in interfaceFSIndexImpl
- Returns:
- the FSIndexComparator structure used by this index
-
getIntComparator
IntComparator getIntComparator() -
getIndexingStrategy
public int getIndexingStrategy() -
init
-
getKeyCode
-
getFeatureOffset
-
ll_compare
public int ll_compare(int fs1, int fs2) Note: may return other than -1 , 0, and 1 (e.g., might return -6)- Specified by:
ll_compare
in interfaceLowLevelIndex
- Parameters:
fs1
- -fs2
- -- Returns:
- 0 if equal, < 0 if fs1 < fs2, > 0 if fs1 > fs2
-
compare
public int compare(int fs1, int fs2) Note: may return other than -1 , 0, and 1 (e.g., might return -6)- Specified by:
compare
in interfaceIntComparator
- Parameters:
fs1
- -fs2
- -- Returns:
- 0 if equal, < 0 if fs1 < fs2, > 0 if fs1 > fs2
-
hashCode
public int hashCode() -
equals
- Specified by:
equals
in interfaceComparator<T extends FeatureStructure>
- Overrides:
equals
in classObject
-
compare
- Specified by:
compare
in interfaceComparator<T extends FeatureStructure>
- See Also:
-
getType
- Returns:
- The type of feature structures in this index.
- See Also:
-
getTypeCode
int getTypeCode() -
refIterator
-
getIntIterator
- Specified by:
getIntIterator
in interfaceFSIndexImpl
-
bulkAddTo
For serialization: get all the items in this index and bulk add to an IntVector- Parameters:
v
- the set of items to add
-
refIterator
-
iterator
-
deleteFS
Method deleteFS.- Parameters:
fs
- -
-
ll_iterator
Description copied from interface:LowLevelIndex
Get a low-level, FS reference iterator. This iterator can be disambiguated. This means that only non-overlapping annotations will be returned. Non-annotation FSs will be filtered in this mode.- Specified by:
ll_iterator
in interfaceLowLevelIndex
- Parameters:
ambiguous
- When set tofalse
, iterator will be disambiguated.- Returns:
- An iterator for this index.
-
ll_rootIterator
Description copied from interface:LowLevelIndex
Get a low-level, FS reference iterator specifying instances of the precise type only (i.e. without listing the subtypes).- Specified by:
ll_rootIterator
in interfaceLowLevelIndex
- Returns:
- An iterator for the root type of this index.
-