|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.internal.util.SortedIntSet
public class SortedIntSet
A set of integers, maintained as a sorted array. Note that the actual array used to implement this class grows in larger increments, so it is efficient to use this class even when doing lots of insertions.
Constructor Summary | |
---|---|
SortedIntSet()
Default constructor. |
|
SortedIntSet(int[] array)
|
Method Summary | |
---|---|
boolean |
add(int ele)
Add element to set. |
boolean |
contains(int ele)
|
int |
find(int ele)
Find position of ele in set. |
int |
get(int pos)
Get element at position. |
boolean |
remove(int ele)
Remove element from set. |
void |
removeAll()
|
int |
size()
Number of elements in set. |
int[] |
toArray()
|
void |
union(SortedIntSet set)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortedIntSet()
public SortedIntSet(int[] array)
Method Detail |
---|
public int find(int ele)
ele
in set.
ele
- The element we're looking for.
IntArrayUtils.binarySearch()
.public boolean contains(int ele)
true
iff ele
public boolean add(int ele)
true
iff ele
was not already contained in the set.public boolean remove(int ele)
true
iff ele
was actually contained in the set.public int size()
public int get(int pos)
pos
- Get element at this position.
public void union(SortedIntSet set)
public void removeAll()
public int[] toArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |