public class IntRangeSet extends AbstractIntSet implements IntSet
Constructor and 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 and 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
|
IntSet |
copy()
Create a copy of this IntSet that leaves the original unchanged.
|
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
|
IntSet |
mutableCopy()
Create a copy of this IntSet that contains the same set of integers.
|
boolean |
remove(int value)
Remove an integer from the set
|
int |
size()
Get the number of integers in the set
|
java.lang.String |
toString() |
containsAll, except, intersect, union
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, except, intersect, union
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 IntSet copy()
IntSet
public IntSet mutableCopy()
IntSet
mutableCopy
in interface 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 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()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.