Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-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:
Serializable, Iterable, Collection, Set, SortedSet
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterSortedSet
extends ConverterCollections.ConverterSet
implements SortedSet, 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(SortedSet set, Converter convUp, Converter convDown)
          Constructor.

 

Method Summary
 Comparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
 Object first()
          Returns the first (lowest) element currently in this sorted set.
 SortedSet getSortedSet()
          Return the underlying SortedSet.
 SortedSet headSet(Object toElement)
          Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
protected  SortedSet instantiateSortedSet(SortedSet set, Converter convUp, Converter convDown)
          Create a Converter SortedSet.
 Object last()
          Returns the last (highest) element currently in this sorted set.
 SortedSet subSet(Object fromElement, Object toElement)
          Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.
 SortedSet tailSet(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(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 Comparator comparator()
Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
Specified by:
comparator in interface SortedSet
Returns:
the comparator associated with this sorted set, or null if it uses its elements' natural ordering

subSet

public SortedSet subSet(Object fromElement,
                        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 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 SortedSet headSet(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 SortedSet
Parameters:
toElement - high endpoint (exclusive) of the headSet
Returns:
a view of the specified initial range of this sorted set

tailSet

public SortedSet tailSet(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 SortedSet
Parameters:
fromElement - low endpoint (inclusive) of the tailSet
Returns:
a view of the specified final range of this sorted set

first

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

last

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

instantiateSortedSet

protected SortedSet instantiateSortedSet(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 SortedSet getSortedSet()
Return the underlying SortedSet.
Returns:
the underlying SortedSet

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.