java.io.Serializable
, IntSet
public class IntRangeSet extends java.lang.Object implements java.io.Serializable, IntSet
Constructor | Description |
---|---|
IntRangeSet() |
Create an empty set
|
IntRangeSet(int[] startPoints,
int[] endPoints) |
Create an IntRangeSet given the start points and end points of the integer ranges.
|
IntRangeSet(IntRangeSet input) |
Create one IntRangeSet as a copy of another
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(int value) |
Add an integer to the set
|
void |
addRange(int low,
int high) |
Add a range of integers to the set.
|
void |
clear() |
Clear the contents of the IntSet (making it an empty set)
|
boolean |
contains(int value) |
Determine whether a particular integer is present in the set
|
boolean |
containsAll(IntSet other) |
Test if this set is a superset of another set
|
boolean |
equals(java.lang.Object other) |
Test whether this set has exactly the same members as another set.
|
int[] |
getEndPoints() |
Get the end points of the ranges
|
int |
getNumberOfRanges() |
Get the number of ranges actually in use
|
int[] |
getStartPoints() |
Get the start points of the ranges
|
int |
hashCode() |
Construct a hash key that supports the equals() test
|
boolean |
isEmpty() |
Determine if the set is empty
|
IntIterator |
iterator() |
Get an iterator over the values
|
boolean |
remove(int value) |
Remove an integer from the set
|
int |
size() |
Get the number of integers in the set
|
java.lang.String |
toString() |
public IntRangeSet()
public IntRangeSet(IntRangeSet input)
input
- the IntRangeSet to be copiedpublic IntRangeSet(int[] startPoints, int[] endPoints)
startPoints
- the start points of the integer rangesendPoints
- the end points of the integer rangesjava.lang.IllegalArgumentException
- if the two arrays are different lengths. Other error conditions
in the input are not currently detected.public void clear()
IntSet
public int size()
IntSet
public boolean isEmpty()
IntSet
public boolean contains(int value)
IntSet
public boolean remove(int value)
IntSet
public boolean add(int value)
public IntIterator iterator()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean containsAll(IntSet other)
containsAll
in interface IntSet
public void addRange(int low, int high)
low
- the low end of the new rangehigh
- the high end of the new rangepublic int[] getStartPoints()
public int[] getEndPoints()
public int getNumberOfRanges()