CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.util
Class RestrictedCollections

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.RestrictedCollections

public class RestrictedCollections
extends Base

A collection of Collection implementation classes that limit the data type.

Author:
cp 2001.10.09

Nested Class Summary
static class RestrictedCollections.RestrictedCollection
          A restricted Collection that requires its contents to be of a specified class.
static class RestrictedCollections.RestrictedEntrySet
          A restricted Collection that requires its contents to be of a specified class.
static class RestrictedCollections.RestrictedList
          A restricted List that requires its contents to be of a specified class.
static class RestrictedCollections.RestrictedListIterator
          A restricted ListIterator that requires its contents to be of a specified class.
static class RestrictedCollections.RestrictedMap
          A restricted Map that requires its keys and values to be of specified classes.
static class RestrictedCollections.RestrictedSet
          A restricted Set that requires its contents to be of a specified class.
static class RestrictedCollections.RestrictedSortedMap
          A restricted SortedMap that requires its keys and values to be of specified classes.
static class RestrictedCollections.RestrictedSortedSet
          A restricted Set that requires its contents to be of a specified class.
 
Method Summary
static Collection getCollection(Collection col, Class clz)
          Returns a restricted instance of Collection.
static Set getEntrySet(Set set, Class clzKey, Class clzVal)
          Returns a restricted instance of Set that holds Entry objects for a RestrictedMap.
static List getList(List list, Class clz)
          Returns a restricted instance of List.
static ListIterator getListIterator(ListIterator iter, Class clz)
          Returns a restricted instance of ListIterator.
static Map getMap(Map map, Class clzKey, Class clzVal)
          Returns a restricted instance of Map.
static Set getSet(Set set, Class clz)
          Returns a restricted instance of Set.
static SortedMap getSortedMap(SortedMap map, Class clzKey, Class clzVal)
          Returns a restricted instance of SortedMap.
static SortedSet getSortedSet(SortedSet set, Class clz)
          Returns a restricted instance of SortedSet.
 

Method Detail

getCollection

public static Collection getCollection(Collection col,
                                       Class clz)
Returns a restricted instance of Collection.

Parameters:
col - the underlying Collection
clz - the class of objects that may be stored in the Collection
Returns:
a restricted Collection that requires its contents to be of the specified class

getSet

public static Set getSet(Set set,
                         Class clz)
Returns a restricted instance of Set.

Parameters:
set - the underlying Set
clz - the class of objects that may be stored in the Set
Returns:
a restricted Set that requires its contents to be of the specified class

getSortedSet

public static SortedSet getSortedSet(SortedSet set,
                                     Class clz)
Returns a restricted instance of SortedSet.

Parameters:
set - the underlying SortedSet
clz - the class of objects that may be stored in the SortedSet
Returns:
a restricted SortedSet that requires its contents to be of the specified class

getList

public static List getList(List list,
                           Class clz)
Returns a restricted instance of List.

Parameters:
list - the underlying List
clz - the class of objects that may be stored in the List
Returns:
a restricted List that requires its contents to be of the specified class

getListIterator

public static ListIterator getListIterator(ListIterator iter,
                                           Class clz)
Returns a restricted instance of ListIterator.

Parameters:
iter - the underlying ListIterator
clz - the class of objects that may be stored in the List
Returns:
a restricted ListIterator that requires its contents to be of the specified class

getMap

public static Map getMap(Map map,
                         Class clzKey,
                         Class clzVal)
Returns a restricted instance of Map.

Parameters:
map - the underlying Map
clzKey - the class of keys that may be stored in the Map
clzVal - the class of values that may be stored in the Map
Returns:
a restricted Map that requires its keys and values to be of the specified classes

getSortedMap

public static SortedMap getSortedMap(SortedMap map,
                                     Class clzKey,
                                     Class clzVal)
Returns a restricted instance of SortedMap.

Parameters:
map - the underlying SortedMap
clzKey - the class of keys that may be stored in the SortedMap
clzVal - the class of values that may be stored in the SortedMap
Returns:
a restricted SortedMap that requires its keys and values to be of the specified classes

getEntrySet

public static Set getEntrySet(Set set,
                              Class clzKey,
                              Class clzVal)
Returns a restricted instance of Set that holds Entry objects for a RestrictedMap.

Parameters:
set - the underlying Entry Set
clzKey - the class of keys that may be stored in the Map
clzVal - the class of values that may be stored in the Map
Returns:
a restricted Set that requires its contents to be Entry objects with the specified key and value restrictions

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation