Package org.antlr.misc
Interface IntSet
- All Known Implementing Classes:
BitSet
,IntervalSet
public interface IntSet
A generic set of ints that has an efficient implementation, BitSet,
which is a compressed bitset and is useful for ints that
are small, for example less than 500 or so, and w/o many ranges. For
ranges with large values like unicode char sets, this is not very efficient.
Consider using IntervalSet. Not all methods in IntervalSet are implemented.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int el) Add an element to the setvoid
Add all elements from incoming set to this set.Return the intersection of this set with the argument, creating a new set.complement
(IntSet elements) boolean
int
boolean
isNil()
boolean
member
(int el) void
remove
(int el) remove this element from this setint
size()
Return the size of this set (not the underlying implementation's allocated memory size, for example).toList()
toString()
-
Method Details
-
add
void add(int el) Add an element to the set -
addAll
Add all elements from incoming set to this set. Can limit to set of its own type. -
and
Return the intersection of this set with the argument, creating a new set. -
complement
-
or
-
subtract
-
size
int size()Return the size of this set (not the underlying implementation's allocated memory size, for example). -
isNil
boolean isNil() -
equals
-
getSingleElement
int getSingleElement() -
member
boolean member(int el) -
remove
void remove(int el) remove this element from this set -
toList
List toList() -
toString
String toString() -
toString
-