Package org.apache.uima.internal.util
Class SortedIntSet
java.lang.Object
org.apache.uima.internal.util.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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanadd(int ele) Add element to set.booleancontains(int ele) intfind(int ele) Find position ofelein set.intget(int pos) Get element at position.int[]getArray()booleanremove(int ele) Remove element from set.voidintsize()Number of elements in set.int[]toArray()voidunion(SortedIntSet set) 
- 
Constructor Details- 
SortedIntSetpublic SortedIntSet()Default constructor.
- 
SortedIntSetpublic SortedIntSet(int[] array) 
 
- 
- 
Method Details- 
findpublic int find(int ele) Find position ofelein set.- Parameters:
- ele- The element we're looking for.
- Returns:
- The position, if found; a negative value, else. See
         IntArrayUtils.binarySearch().
 
- 
containspublic boolean contains(int ele) - Parameters:
- ele- -
- Returns:
- trueiff- eleis contained in the set.
 
- 
addpublic boolean add(int ele) Add element to set.- Parameters:
- ele- -
- Returns:
- trueiff- elewas not already contained in the set.
 
- 
removepublic boolean remove(int ele) Remove element from set.- Parameters:
- ele- -
- Returns:
- trueiff- elewas actually contained in the set.
 
- 
sizepublic int size()Number of elements in set.- Returns:
- Current number of elements in set.
 
- 
getpublic int get(int pos) Get element at position.- Parameters:
- pos- Get element at this position.
- Returns:
- The element at this position.
 
- 
union
- 
removeAllpublic void removeAll()
- 
toArraypublic int[] toArray()
- 
getArraypublic int[] getArray()
 
-