org.compass.core.util.backport.java.util.concurrent
Class ConcurrentSkipListMap.KeySet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet
          extended by org.compass.core.util.backport.java.util.AbstractSet
              extended by org.compass.core.util.backport.java.util.concurrent.ConcurrentSkipListMap.KeySet
All Implemented Interfaces:
Iterable, Collection, Set, SortedSet, NavigableSet
Enclosing class:
ConcurrentSkipListMap

static final class ConcurrentSkipListMap.KeySet
extends AbstractSet
implements NavigableSet


Constructor Summary
ConcurrentSkipListMap.KeySet(ConcurrentNavigableMap map)
           
 
Method Summary
 Object ceiling(Object e)
          Returns the least element in this set greater than or equal to the given element, or null if there is no such element.
 void clear()
           
 Comparator comparator()
           
 boolean contains(Object o)
           
 Iterator descendingIterator()
          Returns an iterator over the elements in this set, in descending order.
 NavigableSet descendingSet()
          Returns a reverse order view of the elements contained in this set.
 boolean equals(Object o)
           
 Object first()
           
 Object floor(Object e)
          Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
 SortedSet headSet(Object toElement)
           Equivalent to headSet(toElement, false).
 NavigableSet headSet(Object toElement, boolean inclusive)
          Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement.
 Object higher(Object e)
          Returns the least element in this set strictly greater than the given element, or null if there is no such element.
 boolean isEmpty()
           
 Iterator iterator()
          Returns an iterator over the elements in this set, in ascending order.
 Object last()
           
 Object lower(Object e)
          Returns the greatest element in this set strictly less than the given element, or null if there is no such element.
 Object pollFirst()
          Retrieves and removes the first (lowest) element, or returns null if this set is empty.
 Object pollLast()
          Retrieves and removes the last (highest) element, or returns null if this set is empty.
 boolean remove(Object o)
           
 int size()
           
 NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive)
          Returns a view of the portion of this set whose elements range from fromElement to toElement.
 SortedSet subSet(Object fromElement, Object toElement)
           Equivalent to subSet(fromElement, true, toElement, false).
 SortedSet tailSet(Object fromElement)
           Equivalent to tailSet(fromElement, true).
 NavigableSet tailSet(Object fromElement, boolean inclusive)
          Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) fromElement.
 
Methods inherited from class org.compass.core.util.backport.java.util.AbstractSet
toArray, toArray
 
Methods inherited from class java.util.AbstractSet
hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, containsAll, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

ConcurrentSkipListMap.KeySet

ConcurrentSkipListMap.KeySet(ConcurrentNavigableMap map)
Method Detail

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Set
Specified by:
size in class AbstractCollection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface Set
Overrides:
isEmpty in class AbstractCollection

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface Set
Overrides:
contains in class AbstractCollection

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface Set
Overrides:
remove in class AbstractCollection

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface Set
Overrides:
clear in class AbstractCollection

lower

public Object lower(Object e)
Description copied from interface: NavigableSet
Returns the greatest element in this set strictly less than the given element, or null if there is no such element.

Specified by:
lower in interface NavigableSet
Parameters:
e - the value to match
Returns:
the greatest element less than e, or null if there is no such element

floor

public Object floor(Object e)
Description copied from interface: NavigableSet
Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.

Specified by:
floor in interface NavigableSet
Parameters:
e - the value to match
Returns:
the greatest element less than or equal to e, or null if there is no such element

ceiling

public Object ceiling(Object e)
Description copied from interface: NavigableSet
Returns the least element in this set greater than or equal to the given element, or null if there is no such element.

Specified by:
ceiling in interface NavigableSet
Parameters:
e - the value to match
Returns:
the least element greater than or equal to e, or null if there is no such element

higher

public Object higher(Object e)
Description copied from interface: NavigableSet
Returns the least element in this set strictly greater than the given element, or null if there is no such element.

Specified by:
higher in interface NavigableSet
Parameters:
e - the value to match
Returns:
the least element greater than e, or null if there is no such element

comparator

public Comparator comparator()
Specified by:
comparator in interface SortedSet

first

public Object first()
Specified by:
first in interface SortedSet

last

public Object last()
Specified by:
last in interface SortedSet

pollFirst

public Object pollFirst()
Description copied from interface: NavigableSet
Retrieves and removes the first (lowest) element, or returns null if this set is empty.

Specified by:
pollFirst in interface NavigableSet
Returns:
the first element, or null if this set is empty

pollLast

public Object pollLast()
Description copied from interface: NavigableSet
Retrieves and removes the last (highest) element, or returns null if this set is empty.

Specified by:
pollLast in interface NavigableSet
Returns:
the last element, or null if this set is empty

iterator

public Iterator iterator()
Description copied from interface: NavigableSet
Returns an iterator over the elements in this set, in ascending order.

Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Set
Specified by:
iterator in interface NavigableSet
Specified by:
iterator in class AbstractCollection
Returns:
an iterator over the elements in this set, in ascending order

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Specified by:
equals in interface Set
Overrides:
equals in class AbstractSet

descendingIterator

public Iterator descendingIterator()
Description copied from interface: NavigableSet
Returns an iterator over the elements in this set, in descending order. Equivalent in effect to descendingSet().iterator().

Specified by:
descendingIterator in interface NavigableSet
Returns:
an iterator over the elements in this set, in descending order

subSet

public NavigableSet subSet(Object fromElement,
                           boolean fromInclusive,
                           Object toElement,
                           boolean toInclusive)
Description copied from interface: NavigableSet
Returns a view of the portion of this set whose elements range from fromElement to toElement. If fromElement and toElement are equal, the returned set is empty unless fromExclusive and toExclusive are both true. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Specified by:
subSet in interface NavigableSet
Parameters:
fromElement - low endpoint of the returned set
fromInclusive - true if the low endpoint is to be included in the returned view
toElement - high endpoint of the returned set
toInclusive - true if the high endpoint is to be included in the returned view
Returns:
a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive

headSet

public NavigableSet headSet(Object toElement,
                            boolean inclusive)
Description copied from interface: NavigableSet
Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Specified by:
headSet in interface NavigableSet
Parameters:
toElement - high endpoint of the returned set
inclusive - true if the high endpoint is to be included in the returned view
Returns:
a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement

tailSet

public NavigableSet tailSet(Object fromElement,
                            boolean inclusive)
Description copied from interface: NavigableSet
Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Specified by:
tailSet in interface NavigableSet
Parameters:
fromElement - low endpoint of the returned set
inclusive - true if the low endpoint is to be included in the returned view
Returns:
a view of the portion of this set whose elements are greater than or equal to fromElement

subSet

public SortedSet subSet(Object fromElement,
                        Object toElement)
Description copied from interface: NavigableSet

Equivalent to subSet(fromElement, true, toElement, false).

Specified by:
subSet in interface SortedSet
Specified by:
subSet in interface NavigableSet

headSet

public SortedSet headSet(Object toElement)
Description copied from interface: NavigableSet

Equivalent to headSet(toElement, false).

Specified by:
headSet in interface SortedSet
Specified by:
headSet in interface NavigableSet

tailSet

public SortedSet tailSet(Object fromElement)
Description copied from interface: NavigableSet

Equivalent to tailSet(fromElement, true).

Specified by:
tailSet in interface SortedSet
Specified by:
tailSet in interface NavigableSet

descendingSet

public NavigableSet descendingSet()
Description copied from interface: NavigableSet
Returns a reverse order view of the elements contained in this set. The descending set is backed by this set, so changes to the set are reflected in the descending set, and vice-versa. If either set is modified while an iteration over either set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined.

The returned set has an ordering equivalent to Collections.reverseOrder(comparator()). The expression s.descendingSet().descendingSet() returns a view of s essentially equivalent to s.

Specified by:
descendingSet in interface NavigableSet
Returns:
a reverse order view of this set


Copyright (c) 2004-2006 The Compass Project.