net.sf.saxon.sort
Class IntRangeSet
java.lang.Object
net.sf.saxon.sort.IntRangeSet
- Serializable, IntSet
public class IntRangeSet
extends java.lang.Object
implements Serializable, IntSet
Set of int values. This implementation of IntSet uses a sorted array
of integer ranges.
IntRangeSet
public IntRangeSet()
Create an empty set
IntRangeSet
public IntRangeSet(IntRangeSet input)
Create one IntRangeSet as a copy of another
input
- the IntRangeSet to be copied
add
public boolean add(int value)
Add an integer to the set
- add in interface IntSet
value
- the integer to be added
- true if the integer was added, false if it was already present
addRange
public void addRange(int low,
int high)
Add a range of integers to the set.
This is optimized for the case where these are all greater than any existing integer
in the set.
low
- the low end of the new rangehigh
- the high end of the new range
contains
public boolean contains(int value)
- contains in interface IntSet
containsAll
public boolean containsAll(IntSet other)
Test if this set is a superset of another set
- containsAll in interface IntSet
equals
public boolean equals(Object other)
Test whether this set has exactly the same members as another set. Note that
IntRangeSet values are NOT comparable with other implementations of IntSet
getEndPoints
public int[] getEndPoints()
Get the end points of the ranges
getNumberOfRanges
public int getNumberOfRanges()
Get the number of ranges actually in use
getStartPoints
public int[] getStartPoints()
Get the start points of the ranges
hashCode
public int hashCode()
Construct a hash key that supports the equals() test
remove
public boolean remove(int value)
- remove in interface IntSet
toString
public String toString()