Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.util
Class RestrictedCollections.RestrictedSortedSet

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.RestrictedCollections.RestrictedCollection
          extended by com.tangosol.util.RestrictedCollections.RestrictedSet
              extended by com.tangosol.util.RestrictedCollections.RestrictedSortedSet

All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.Set, java.util.SortedSet
Enclosing class:
RestrictedCollections

public static class RestrictedCollections.RestrictedSortedSet
extends RestrictedCollections.RestrictedSet
implements java.util.SortedSet, java.io.Serializable

A restricted Set that requires its contents to be of a specified class.


Field Summary

 

Fields inherited from class com.tangosol.util.RestrictedCollections.RestrictedCollection
m_clz, m_col

 

Constructor Summary
RestrictedCollections.RestrictedSortedSet(java.util.SortedSet set, java.lang.Class clz)
          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 headSet(java.lang.Object toElement)
          Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
 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.RestrictedCollections.RestrictedCollection
add, addAll, checkObject, clear, contains, containsAll, equals, hashCode, 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

RestrictedCollections.RestrictedSortedSet

public RestrictedCollections.RestrictedSortedSet(java.util.SortedSet set,
                                                 java.lang.Class clz)
Constructor.
Parameters:
set - the underlying SortedSet
clz - the class of objects that may be stored in the 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:
NoSuchElementException - 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:
NoSuchElementException - sorted set is empty

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


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