Package org.apache.uima.internal.util
Class CopyOnWriteOrderedFsSet_array<T extends FeatureStructure>
- java.lang.Object
-
- org.apache.uima.internal.util.CopyOnWriteOrderedFsSet_array<T>
-
- All Implemented Interfaces:
CopyOnWriteIndexPart<T>
public class CopyOnWriteOrderedFsSet_array<T extends FeatureStructure> extends java.lang.Object implements CopyOnWriteIndexPart<T>
implements OrderedFsSet_array partially, for iterator use
-
-
Field Summary
Fields Modifier and Type Field Description T[]
a
int
a_firstUsedslot
int
a_nextFreeslot
OrderedFsSet_array<T>
original
private int
original_size
private OrderedFsSet_array<T>
set
-
Constructor Summary
Constructors Constructor Description CopyOnWriteOrderedFsSet_array(OrderedFsSet_array<T> original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
copyToArray(T[] target, int startingIndexInTarget)
Copy FS refs to target from this index partboolean
equals(java.lang.Object obj)
OrderedFsSet_array<T>
getOfsa()
int
hashCode()
boolean
isOriginal()
java.util.Iterator<T>
iterator()
void
makeReadOnlyCopy()
Called by index when about to make an update This copy captures the state of things before the update happensint
size()
java.lang.String
toString()
-
-
-
Field Detail
-
set
private OrderedFsSet_array<T extends FeatureStructure> set
-
a_firstUsedslot
public final int a_firstUsedslot
-
a_nextFreeslot
public final int a_nextFreeslot
-
original
public final OrderedFsSet_array<T extends FeatureStructure> original
-
original_size
private final int original_size
-
a
public T extends FeatureStructure[] a
-
-
Constructor Detail
-
CopyOnWriteOrderedFsSet_array
public CopyOnWriteOrderedFsSet_array(OrderedFsSet_array<T> original)
-
-
Method Detail
-
makeReadOnlyCopy
public void makeReadOnlyCopy()
Called by index when about to make an update This copy captures the state of things before the update happens- Specified by:
makeReadOnlyCopy
in interfaceCopyOnWriteIndexPart<T extends FeatureStructure>
-
isOriginal
public boolean isOriginal()
- Specified by:
isOriginal
in interfaceCopyOnWriteIndexPart<T extends FeatureStructure>
- Returns:
- true if this cow version is the same as the original. true means the index has not been updated
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
size
public final int size()
- Specified by:
size
in interfaceCopyOnWriteIndexPart<T extends FeatureStructure>
- Returns:
- the size of this version of the index (maybe not the current index size)
- See Also:
OrderedFsSet_array.size()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
OrderedFsSet_array.toString()
-
getOfsa
public OrderedFsSet_array<T> getOfsa()
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfaceCopyOnWriteIndexPart<T extends FeatureStructure>
- Returns:
- iterator over all the elements
-
copyToArray
public int copyToArray(T[] target, int startingIndexInTarget)
Description copied from interface:CopyOnWriteIndexPart
Copy FS refs to target from this index part- Specified by:
copyToArray
in interfaceCopyOnWriteIndexPart<T extends FeatureStructure>
- Parameters:
target
- the target array to copy intostartingIndexInTarget
- the starting index in the target array- Returns:
- startingIndexInTarget + size
-
-