edu.emory.mathcs.util.collections.ints
Class AbstractIntSortedSet.AbstractSubView

java.lang.Object
  extended byedu.emory.mathcs.util.collections.ints.AbstractIntCollection
      extended byedu.emory.mathcs.util.collections.ints.AbstractIntSet
          extended byedu.emory.mathcs.util.collections.ints.AbstractIntSortedSet
              extended byedu.emory.mathcs.util.collections.ints.AbstractIntSortedSet.AbstractSubView
All Implemented Interfaces:
IntCollection, IntSet, IntSortedSet, java.io.Serializable
Enclosing class:
AbstractIntSortedSet

protected abstract static class AbstractIntSortedSet.AbstractSubView
extends AbstractIntSortedSet
implements java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntSortedSet
AbstractIntSortedSet.AbstractComplementSubView, AbstractIntSortedSet.AbstractSubView, AbstractIntSortedSet.ForwardIntervalItemIterator, AbstractIntSortedSet.ReverseIntervalItemIterator
 
Field Summary
protected  IntSortedSet base
           
protected  int beg
           
protected  int end
           
 
Constructor Summary
protected AbstractIntSortedSet.AbstractSubView(IntSortedSet base, int beg, int end)
           
 
Method Summary
 boolean add(int e)
          Adds the specified number to this set if it is not already present and if it falls within the domain.
 boolean addInterval(int first, int last)
          Adds to this set all the numbers between first and last, inclusive, that are not already present in this set and beint to this set's domain.
 IntInterval ceilingInterval(int e)
          Returns the smallest (left-most), widest interval contained in this set which elements are not all smaller than the specified number.
 void clear()
          Removes all of the elements from this set.
 boolean contains(int e)
          Returns true if this set contains the specified number; false otherwise.
 boolean containsInterval(int first, int last)
          Returns true if this set contains all the numbers between first and last, inclusive; false otherwise.
abstract  java.util.Iterator descendingIntervalIterator()
          Returns an iterator over intervals of this set, in a decreasing numerical order.
 IntInterval enclosingInterval(int e)
          Returns the widest interval contained in this set that includes the specified number, or null if this set does not include the specified number.
 IntInterval floorInterval(int e)
          Returns the largest (right-most), widest interval contained in this set which elements are not all greater than the specified number.
 IntInterval higherInterval(int e)
          Returns the smallest (left-most), widest interval contained in this set which all elements are strictly greater than the specified number.
 int intervalCount()
          Returns the minimum count of intervals into which this set can be decomposed.
abstract  java.util.Iterator intervalIterator()
          Returns an iterator over intervals of this set, in an increasing numerical order.
 IntInterval lowerInterval(int e)
          Returns the largest and widest interval contained in this set which all elements are strictly less than the specified number.
 int max()
          The largest number that can be stored in this set.
 int min()
          The smallest number that can be stored in this set.
 boolean remove(int e)
          Removes the specified number from this set if it is present.
 boolean removeInterval(int first, int last)
          Removes from this set all the numbers between first and last, inclusive.
 int size64()
          Returns the number of elements in this set.
abstract  IntSortedSet subSet(int first, int last)
          A subset view containing all elements from this set between first, inclusive, and last, inclusive.
 
Methods inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntSortedSet
ceiling, descendingIterator, first, firstInterval, floor, headSet, higher, isEmpty, iterator, last, lastInterval, lower, pollFirst, pollFirstInterval, pollLast, pollLastInterval, retainAll, retainInterval, tailSet, toCompactString
 
Methods inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntSet
addAll, complementSet, equals, hashCode, removeAll
 
Methods inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntCollection
containsAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.emory.mathcs.util.collections.ints.IntSortedSet
toString
 
Methods inherited from interface edu.emory.mathcs.util.collections.ints.IntSet
addAll, complementSet, containsAll, equals, hashCode, removeAll, size, toArray, toArray
 

Field Detail

base

protected final IntSortedSet base

beg

protected final int beg

end

protected final int end
Constructor Detail

AbstractIntSortedSet.AbstractSubView

protected AbstractIntSortedSet.AbstractSubView(IntSortedSet base,
                                               int beg,
                                               int end)
Method Detail

min

public int min()
Description copied from interface: IntSet
The smallest number that can be stored in this set.

Specified by:
min in interface IntSet
Overrides:
min in class AbstractIntSet

max

public int max()
Description copied from interface: IntSet
The largest number that can be stored in this set.

Specified by:
max in interface IntSet
Overrides:
max in class AbstractIntSet

size64

public int size64()
Description copied from interface: IntSet
Returns the number of elements in this set.

Specified by:
size64 in interface IntSet
Overrides:
size64 in class AbstractIntSortedSet

intervalCount

public int intervalCount()
Description copied from interface: IntSortedSet
Returns the minimum count of intervals into which this set can be decomposed. For instance, {1, 3,4,5, 8,9}.intervalCount() == 3.

Specified by:
intervalCount in interface IntSortedSet
Overrides:
intervalCount in class AbstractIntSortedSet

clear

public void clear()
Description copied from interface: IntSet
Removes all of the elements from this set. The set will be empty after this call returns.

Specified by:
clear in interface IntSet
Overrides:
clear in class AbstractIntCollection

add

public boolean add(int e)
Description copied from interface: IntSet
Adds the specified number to this set if it is not already present and if it falls within the domain.

Specified by:
add in interface IntSet
Overrides:
add in class AbstractIntCollection

addInterval

public boolean addInterval(int first,
                           int last)
Description copied from interface: IntSet
Adds to this set all the numbers between first and last, inclusive, that are not already present in this set and beint to this set's domain.

Specified by:
addInterval in interface IntSet
Overrides:
addInterval in class AbstractIntSet

remove

public boolean remove(int e)
Description copied from interface: IntSet
Removes the specified number from this set if it is present.

Specified by:
remove in interface IntSet
Overrides:
remove in class AbstractIntCollection

removeInterval

public boolean removeInterval(int first,
                              int last)
Description copied from interface: IntSet
Removes from this set all the numbers between first and last, inclusive.

Specified by:
removeInterval in interface IntSet
Overrides:
removeInterval in class AbstractIntSet

contains

public boolean contains(int e)
Description copied from interface: IntSet
Returns true if this set contains the specified number; false otherwise.

Specified by:
contains in interface IntSet
Overrides:
contains in class AbstractIntCollection

containsInterval

public boolean containsInterval(int first,
                                int last)
Description copied from interface: IntSet
Returns true if this set contains all the numbers between first and last, inclusive; false otherwise.

Specified by:
containsInterval in interface IntSet
Overrides:
containsInterval in class AbstractIntSet

enclosingInterval

public IntInterval enclosingInterval(int e)
Description copied from interface: IntSortedSet
Returns the widest interval contained in this set that includes the specified number, or null if this set does not include the specified number.

Specified by:
enclosingInterval in interface IntSortedSet
Returns:
the interval containing the specified number.

higherInterval

public IntInterval higherInterval(int e)
Description copied from interface: IntSortedSet
Returns the smallest (left-most), widest interval contained in this set which all elements are strictly greater than the specified number.

Specified by:
higherInterval in interface IntSortedSet
Returns:
the smallest interval greater than the specified number.

ceilingInterval

public IntInterval ceilingInterval(int e)
Description copied from interface: IntSortedSet
Returns the smallest (left-most), widest interval contained in this set which elements are not all smaller than the specified number. In other words, it either includes the specified number or has all elements strictly greater than the specified number.

Specified by:
ceilingInterval in interface IntSortedSet
Returns:
the smallest interval which upper bound is >= than the specified number.

lowerInterval

public IntInterval lowerInterval(int e)
Description copied from interface: IntSortedSet
Returns the largest and widest interval contained in this set which all elements are strictly less than the specified number.

Specified by:
lowerInterval in interface IntSortedSet
Returns:
the largest interval smaller than the specified number.

floorInterval

public IntInterval floorInterval(int e)
Description copied from interface: IntSortedSet
Returns the largest (right-most), widest interval contained in this set which elements are not all greater than the specified number. In other words, it either includes the specified number or has all elements strictly less than the specified number.

Specified by:
floorInterval in interface IntSortedSet
Returns:
the largest interval which lower bound is <= than the specified number.

subSet

public abstract IntSortedSet subSet(int first,
                                    int last)
Description copied from interface: IntSortedSet
A subset view containing all elements from this set between first, inclusive, and last, inclusive. More precisely, the view is narrowed to the domain [min, max]. Hence, complement set of this set will NOT include any elements outside [min, max].

Specified by:
subSet in interface IntSortedSet
Parameters:
first - the minimum element of this view (inclusive).
last - the maximum element of this view (inclusive).
Returns:
the subset view

intervalIterator

public abstract java.util.Iterator intervalIterator()
Description copied from interface: IntSortedSet
Returns an iterator over intervals of this set, in an increasing numerical order.

Specified by:
intervalIterator in interface IntSortedSet
Returns:
an iterator over intervals of this set

descendingIntervalIterator

public abstract java.util.Iterator descendingIntervalIterator()
Description copied from interface: IntSortedSet
Returns an iterator over intervals of this set, in a decreasing numerical order.

Specified by:
descendingIntervalIterator in interface IntSortedSet
Returns:
a descending iterator over intervals of this set