public class IntSet extends Object implements PositiveIntSet
Set interface
for performance reasons, though methods with the same name are equivalent.
This does not implement shorts + offset, like the IntHashSet does
because by the time that might be of interest, we would switch to
IntHashSet to get ~O(1) operations including contains.| Constructor and Description |
|---|
IntSet()
Creates a new instance of this set.
|
IntSet(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int element)
Adds the specified int to this set.
|
void |
bulkAddTo(IntVector v)
add all elements in this set to the IntVector v as a bulk operation
|
void |
clear()
remove all members of the set
|
boolean |
contains(int element)
Tests if this set contains the specified element.
|
boolean |
equals(Object o)
Tests if two sets are equal.
|
int |
find(int element) |
int |
get(int n)
Used for FsBagIndex, and internally to compute most positive/neg
|
int |
hashCode() |
int |
indexOf(int element) |
boolean |
isValid(int position)
For FSBagIndex low level iterator use
|
org.apache.uima.internal.util.IntSet.IntSetIterator |
iterator() |
int |
moveToFirst()
For FSBagIndex low level iterator use
|
int |
moveToLast()
For FSBagIndex low level iterator use
|
int |
moveToNext(int position)
For FSBagIndex low level iterator use
|
int |
moveToPrevious(int position)
For FSBagIndex low level iterator use
|
boolean |
remove(int key) |
void |
removeElementAt(int n)
Removes the
n-th element in this set. |
int |
size() |
int[] |
toIntArray() |
String |
toString() |
public IntSet()
public IntSet(int capacity)
capacity - allocate enough space to hold at least this before expandingpublic boolean add(int element)
add in interface PositiveIntSetelement - the integer to be added.true if this set did not already contain this element,
false otherwise.public boolean contains(int element)
contains in interface PositiveIntSetelement - the element to be tested.true if the element is contained in this set, false
otherwise.public int find(int element)
find in interface PositiveIntSetelement - an item which may be in the setpublic int size()
size in interface PositiveIntSetpublic int get(int n)
get in interface PositiveIntSetn - the positionpublic void removeElementAt(int n)
n-th element in this set.n - -public boolean equals(Object o)
public int indexOf(int element)
public void clear()
PositiveIntSetclear in interface PositiveIntSetpublic boolean remove(int key)
remove in interface PositiveIntSetkey - -public org.apache.uima.internal.util.IntSet.IntSetIterator iterator()
iterator in interface PositiveIntSetpublic int moveToFirst()
PositiveIntSetmoveToFirst in interface PositiveIntSetpublic int moveToLast()
PositiveIntSetmoveToLast in interface PositiveIntSetpublic int moveToNext(int position)
PositiveIntSetmoveToNext in interface PositiveIntSetposition - -public int moveToPrevious(int position)
PositiveIntSetmoveToPrevious in interface PositiveIntSetposition - -public boolean isValid(int position)
PositiveIntSetisValid in interface PositiveIntSetposition - -public void bulkAddTo(IntVector v)
PositiveIntSetbulkAddTo in interface PositiveIntSetv - - to be added topublic int[] toIntArray()
toIntArray in interface PositiveIntSetCopyright © 2018. All rights reserved.