Top Description Methods
org.antlr.misc

public Interface IntSet

Known Direct Implementers
org.antlr.misc.BitSet, org.antlr.misc.IntervalSet
Imports
org.antlr.tool.Grammar, java.util.List

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
org.antlr.misc.BitSet, org.antlr.misc.IntervalSet

Method Summary

Modifier and TypeMethod and Description
public void
add(int el)

Add an element to the set

public void
addAll(IntSet set)

Add all elements from incoming set to this set.

public IntSet
and(IntSet a)

Return the intersection of this set with the argument, creating a new set.

public IntSet
complement(IntSet elements)

public boolean
public int
public boolean
public boolean
member(int el)

public IntSet
public void
remove(int el)

remove this element from this set

public int
size()

Return the size of this set (not the underlying implementation's allocated memory size, for example).

public IntSet
public List<Integer>
public String
public String

Method Detail

addback to summary
public void add(int el)

Add an element to the set

addAllback to summary
public void addAll(IntSet set)

Add all elements from incoming set to this set. Can limit to set of its own type.

andback to summary
public IntSet and(IntSet a)

Return the intersection of this set with the argument, creating a new set.

complementback to summary
public IntSet complement(IntSet elements)
equalsback to summary
public boolean equals(Object obj)
Annotations
@Override
getSingleElementback to summary
public int getSingleElement()
isNilback to summary
public boolean isNil()
memberback to summary
public boolean member(int el)
orback to summary
public IntSet or(IntSet a)
removeback to summary
public void remove(int el)

remove this element from this set

sizeback to summary
public int size()

Return the size of this set (not the underlying implementation's allocated memory size, for example).

subtractback to summary
public IntSet subtract(IntSet a)
toListback to summary
public List<Integer> toList()
toStringback to summary
public String toString()
Annotations
@Override
toStringback to summary
public String toString(Grammar g)