edu.emory.mathcs.util.collections.ints
Class AbstractIntInterval.ComplementView

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.AbstractIntInterval.ComplementView
All Implemented Interfaces:
IntCollection, IntSet, IntSortedSet
Enclosing class:
AbstractIntInterval

protected static class AbstractIntInterval.ComplementView
extends AbstractIntSortedSet


Nested Class Summary
 
Nested classes inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntSortedSet
AbstractIntSortedSet.AbstractComplementSubView, AbstractIntSortedSet.AbstractSubView, AbstractIntSortedSet.ForwardIntervalItemIterator, AbstractIntSortedSet.ReverseIntervalItemIterator
 
Method Summary
 IntInterval ceilingInterval(int n)
          Returns the smallest (left-most), widest interval contained in this set which elements are not all smaller than the specified number.
 IntSet complementSet()
          Returns a complement view of 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.
 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.
 int first()
          Returns the smallest number in this set.
 IntInterval firstInterval()
          Returns the first (left-most), widest interval contained in this set, or null if this set is empty.
 IntInterval floorInterval(int n)
          Returns the largest (right-most), widest interval contained in this set which elements are not all greater than the specified number.
 IntInterval higherInterval(int n)
          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.
 java.util.Iterator intervalIterator()
          Returns an iterator over intervals of this set, in an increasing numerical order.
 int last()
          Returns the largest number in this set.
 IntInterval lastInterval()
          Returns the last (right-most), widest interval contained in this set, or null if this set is empty.
 IntInterval lowerInterval(int n)
          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.
 IntInterval pollFirstInterval()
          Returns and removes the first (left-most), widest interval contained in this set, or null if this set is empty.
 IntInterval pollLastInterval()
          Returns and removes the last (right-most), widest interval contained in this set, or null if this set is empty.
 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, floor, headSet, higher, isEmpty, iterator, lower, pollFirst, pollLast, retainAll, retainInterval, size64, tailSet, toCompactString
 
Methods inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntSet
addAll, addInterval, equals, hashCode, removeAll, removeInterval
 
Methods inherited from class edu.emory.mathcs.util.collections.ints.AbstractIntCollection
add, clear, containsAll, remove, 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
add, addAll, addInterval, clear, containsAll, equals, hashCode, remove, removeAll, removeInterval, size, toArray, toArray
 

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

first

public int first()
Description copied from interface: IntSortedSet
Returns the smallest number in this set.

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

last

public int last()
Description copied from interface: IntSortedSet
Returns the largest number in this set.

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

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.

Returns:
the interval containing the specified number.

higherInterval

public IntInterval higherInterval(int n)
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.

Returns:
the smallest interval greater than the specified number.

ceilingInterval

public IntInterval ceilingInterval(int n)
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.

Returns:
the smallest interval which upper bound is >= than the specified number.

lowerInterval

public IntInterval lowerInterval(int n)
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.

Returns:
the largest interval smaller than the specified number.

floorInterval

public IntInterval floorInterval(int n)
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.

Returns:
the largest interval which lower bound is <= than the specified number.

firstInterval

public IntInterval firstInterval()
Description copied from interface: IntSortedSet
Returns the first (left-most), widest interval contained in this set, or null if this set is empty.

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

lastInterval

public IntInterval lastInterval()
Description copied from interface: IntSortedSet
Returns the last (right-most), widest interval contained in this set, or null if this set is empty.

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

pollFirstInterval

public IntInterval pollFirstInterval()
Description copied from interface: IntSortedSet
Returns and removes the first (left-most), widest interval contained in this set, or null if this set is empty.

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

pollLastInterval

public IntInterval pollLastInterval()
Description copied from interface: IntSortedSet
Returns and removes the last (right-most), widest interval contained in this set, or null if this set is empty.

Specified by:
pollLastInterval in interface IntSortedSet
Overrides:
pollLastInterval 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

subSet

public 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].

Parameters:
first - the minimum element of this view (inclusive).
last - the maximum element of this view (inclusive).
Returns:
the subset view

complementSet

public IntSet complementSet()
Description copied from interface: IntSet
Returns a complement view of this set. Complement view is a set that has the same domain as this set, and consists of all numbers from the domain that are not contained in this set. Changes done to this set are reflected in the complement view after it is created.

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

intervalIterator

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

Returns:
an iterator over intervals of this set

descendingIntervalIterator

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

Returns:
a descending iterator over intervals of this set