Oracle® Coherence Java API Reference
v3.5

E14977-01

com.tangosol.util
Class ConverterCollections.ConverterSortedSet

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterCollections.ConverterCollection
          extended by com.tangosol.util.ConverterCollections.ConverterSet
              extended by com.tangosol.util.ConverterCollections.ConverterSortedSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.Set, java.util.SortedSet
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterSortedSet
extends ConverterCollections.ConverterSet
implements java.util.SortedSet, java.io.Serializable

A Converter SortedSet views an underlying SortedSet through a Converter.


Field Summary
 
Fields inherited from class com.tangosol.util.ConverterCollections.ConverterCollection
m_col, m_convDown, m_convUp
 
Constructor Summary
ConverterCollections.ConverterSortedSet(java.util.SortedSet set, Converter convUp, Converter convDown)
          Constructor.
 
Method Summary
 java.util.Comparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
 java.lang.Object first()
          Returns the first (lowest) element currently in this sorted set.
 java.util.SortedSet getSortedSet()
          Return the underlying SortedSet.
 java.util.SortedSet headSet(java.lang.Object toElement)
          Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
protected  java.util.SortedSet instantiateSortedSet(java.util.SortedSet set, Converter convUp, Converter convDown)
          Create a Converter SortedSet.
 java.lang.Object last()
          Returns the last (highest) element currently in this sorted set.
 java.util.SortedSet subSet(java.lang.Object fromElement, java.lang.Object toElement)
          Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.
 java.util.SortedSet tailSet(java.lang.Object fromElement)
          Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement.
 
Methods inherited from class com.tangosol.util.ConverterCollections.ConverterCollection
add, addAll, clear, contains, containsAll, equals, getCollection, getConverterDown, getConverterUp, instantiateCollection, instantiateIterator, invalidate, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

ConverterCollections.ConverterSortedSet

public ConverterCollections.ConverterSortedSet(java.util.SortedSet set,
                                               Converter convUp,
                                               Converter convDown)
Constructor.

Parameters:
set - the underlying SortedSet
convUp - the Converter from the underlying SortedSet
convDown - the Converter to the underlying SortedSet
Method Detail

comparator

public java.util.Comparator comparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.

Specified by:
comparator in interface java.util.SortedSet
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering

subSet

public java.util.SortedSet subSet(java.lang.Object fromElement,
                                  java.lang.Object toElement)
Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned sorted set is empty.) The returned sorted set is backed by this sorted set, so changes in the returned sorted set are reflected in this sorted set, and vice-versa. The returned sorted set supports all optional set operations that this sorted set supports.

Obeys the general contract of SortedSet.subSet.

Specified by:
subSet in interface java.util.SortedSet
Parameters:
fromElement - low endpoint (inclusive) of the subSet
toElement - high endpoint (exclusive) of the subSet
Returns:
a view of the specified range within this sorted set

headSet

public java.util.SortedSet headSet(java.lang.Object toElement)
Returns a view of the portion of this sorted set whose elements are strictly less than toElement. The returned sorted set is backed by this sorted set, so changes in the returned sorted set are reflected in this sorted set, and vice-versa. The returned sorted set supports all optional set operations.

Obeys the general contract of SortedSet.headSet.

Specified by:
headSet in interface java.util.SortedSet
Parameters:
toElement - high endpoint (exclusive) of the headSet
Returns:
a view of the specified initial range of this sorted set

tailSet

public java.util.SortedSet tailSet(java.lang.Object fromElement)
Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement. The returned sorted set is backed by this sorted set, so changes in the returned sorted set are reflected in this sorted set, and vice-versa. The returned sorted set supports all optional set operations.

Obeys the general contract of SortedSet.tailSet.

Specified by:
tailSet in interface java.util.SortedSet
Parameters:
fromElement - low endpoint (inclusive) of the tailSet
Returns:
a view of the specified final range of this sorted set

first

public java.lang.Object first()
Returns the first (lowest) element currently in this sorted set.

Specified by:
first in interface java.util.SortedSet
Returns:
the first (lowest) element currently in this sorted set
Throws:
java.util.NoSuchElementException - if the sorted set is empty

last

public java.lang.Object last()
Returns the last (highest) element currently in this sorted set.

Specified by:
last in interface java.util.SortedSet
Returns:
the last (highest) element currently in this sorted set
Throws:
java.util.NoSuchElementException - if the sorted set is empty

instantiateSortedSet

protected java.util.SortedSet instantiateSortedSet(java.util.SortedSet set,
                                                   Converter convUp,
                                                   Converter convDown)
Create a Converter SortedSet.

Parameters:
set - the underlying SortedSet
convUp - the Converter to view the underlying SortedSet through
convDown - the Converter to pass items down to the underlying SortedSet through
Returns:
a Converter SortedSet

getSortedSet

public java.util.SortedSet getSortedSet()
Return the underlying SortedSet.

Returns:
the underlying SortedSet

Oracle® Coherence Java API Reference
v3.5

E14977-01

Copyright © 2000, 2009, Oracle. All rights reserved.