edu.emory.mathcs.util.collections.shorts
Class AbstractShortSortedSet.AbstractComplementSubView

java.lang.Object
  extended byedu.emory.mathcs.util.collections.shorts.AbstractShortCollection
      extended byedu.emory.mathcs.util.collections.shorts.AbstractShortSet
          extended byedu.emory.mathcs.util.collections.shorts.AbstractShortSortedSet
              extended byedu.emory.mathcs.util.collections.shorts.AbstractShortSortedSet.AbstractComplementSubView
All Implemented Interfaces:
ShortCollection, ShortSet, ShortSortedSet
Enclosing class:
AbstractShortSortedSet

protected abstract static class AbstractShortSortedSet.AbstractComplementSubView
extends AbstractShortSortedSet


Nested Class Summary
 
Nested classes inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortSortedSet
AbstractShortSortedSet.AbstractComplementSubView, AbstractShortSortedSet.AbstractSubView, AbstractShortSortedSet.ForwardIntervalItemIterator, AbstractShortSortedSet.ReverseIntervalItemIterator
 
Field Summary
protected  ShortSortedSet base
           
protected  short beg
           
protected  short end
           
 
Constructor Summary
protected AbstractShortSortedSet.AbstractComplementSubView(ShortSortedSet base, short beg, short end)
           
 
Method Summary
 boolean add(short e)
          Adds the specified number to this set if it is not already present and if it falls within the domain.
 boolean addInterval(short first, short last)
          Adds to this set all the numbers between first and last, inclusive, that are not already present in this set and beshort to this set's domain.
 ShortInterval ceilingInterval(short n)
          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(short e)
          Returns true if this set contains the specified number; false otherwise.
 boolean containsInterval(short first, short 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.
 ShortInterval enclosingInterval(short 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.
 ShortInterval floorInterval(short n)
          Returns the largest (right-most), widest interval contained in this set which elements are not all greater than the specified number.
 ShortInterval higherInterval(short 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.
abstract  java.util.Iterator intervalIterator()
          Returns an iterator over intervals of this set, in an increasing numerical order.
 ShortInterval lowerInterval(short n)
          Returns the largest and widest interval contained in this set which all elements are strictly less than the specified number.
 short max()
          The largest number that can be stored in this set.
 short min()
          The smallest number that can be stored in this set.
 boolean remove(short e)
          Removes the specified number from this set if it is present.
 boolean removeInterval(short first, short last)
          Removes from this set all the numbers between first and last, inclusive.
 
Methods inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortSortedSet
ceiling, descendingIterator, first, firstInterval, floor, headSet, higher, isEmpty, iterator, last, lastInterval, lower, pollFirst, pollFirstInterval, pollLast, pollLastInterval, retainAll, retainInterval, size, tailSet, toCompactString
 
Methods inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortSet
addAll, complementSet, equals, hashCode, removeAll
 
Methods inherited from class edu.emory.mathcs.util.collections.shorts.AbstractShortCollection
containsAll, 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.shorts.ShortSortedSet
subSet, toString
 
Methods inherited from interface edu.emory.mathcs.util.collections.shorts.ShortSet
addAll, complementSet, containsAll, equals, hashCode, removeAll, toArray, toArray
 

Field Detail

base

protected final ShortSortedSet base

beg

protected final short beg

end

protected final short end
Constructor Detail

AbstractShortSortedSet.AbstractComplementSubView

protected AbstractShortSortedSet.AbstractComplementSubView(ShortSortedSet base,
                                                           short beg,
                                                           short end)
Method Detail

min

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

Specified by:
min in interface ShortSet
Overrides:
min in class AbstractShortSet

max

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

Specified by:
max in interface ShortSet
Overrides:
max in class AbstractShortSet

intervalCount

public int intervalCount()
Description copied from interface: ShortSortedSet
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 ShortSortedSet
Overrides:
intervalCount in class AbstractShortSortedSet

add

public boolean add(short e)
Description copied from interface: ShortSet
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 ShortSet
Overrides:
add in class AbstractShortCollection

addInterval

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

Specified by:
addInterval in interface ShortSet
Overrides:
addInterval in class AbstractShortSet

remove

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

Specified by:
remove in interface ShortSet
Overrides:
remove in class AbstractShortCollection

removeInterval

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

Specified by:
removeInterval in interface ShortSet
Overrides:
removeInterval in class AbstractShortSet

contains

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

Specified by:
contains in interface ShortSet
Overrides:
contains in class AbstractShortCollection

containsInterval

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

Specified by:
containsInterval in interface ShortSet
Overrides:
containsInterval in class AbstractShortSet

enclosingInterval

public ShortInterval enclosingInterval(short e)
Description copied from interface: ShortSortedSet
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.

lowerInterval

public ShortInterval lowerInterval(short n)
Description copied from interface: ShortSortedSet
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 ShortInterval floorInterval(short n)
Description copied from interface: ShortSortedSet
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.

higherInterval

public ShortInterval higherInterval(short n)
Description copied from interface: ShortSortedSet
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 ShortInterval ceilingInterval(short n)
Description copied from interface: ShortSortedSet
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.

clear

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

Specified by:
clear in interface ShortSet
Overrides:
clear in class AbstractShortCollection

intervalIterator

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

Returns:
an iterator over intervals of this set

descendingIntervalIterator

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

Returns:
a descending iterator over intervals of this set