|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--viceroy.misc.typeSafeCollections.TypeSafeCollections
This class contains a Collection of static methods which return a wrapper to an existing container interface of the Java Collection Framework. The wrappers make sure, that only objects of a given type can be added to the container.
| Field Summary | |
protected static boolean |
performTypeCheck
|
| Constructor Summary | |
TypeSafeCollections()
|
|
| Method Summary | |
static void |
setPerformTypeCheck(boolean doCheck)
sets the behaviour of all the type-safe collection classes. |
static java.util.Collection |
typeSafeCollection(java.util.Collection collection,
java.lang.Class type)
Returns a wrapper for a type safe java.util.Collection. |
static java.util.List |
typeSafeList(java.util.List list,
java.lang.Class type)
Returns a wrapper for a type safe java.util.List. |
static java.util.Map |
typeSafeMap(java.util.Map map,
java.lang.Class keyType,
java.lang.Class valueType)
Returns a wrapper for a type safe java.util.Map. |
static java.util.Set |
typeSafeSet(java.util.Set set,
java.lang.Class type)
Returns a wrapper for a type safe java.util.Set. |
static java.util.SortedMap |
typeSafeSortedMap(java.util.SortedMap map,
java.lang.Class keyType,
java.lang.Class valueType)
Returns a wrapper for a type safe java.util.SortedMap. |
static java.util.SortedSet |
typeSafeSortedSet(java.util.SortedSet set,
java.lang.Class type)
Returns a wrapper for a type safe java.util.SortedSet. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static boolean performTypeCheck
| Constructor Detail |
public TypeSafeCollections()
| Method Detail |
public static void setPerformTypeCheck(boolean doCheck)
doCheck - true enables the run-time type check,
false disables the run-time check.
public static java.util.Collection typeSafeCollection(java.util.Collection collection,
java.lang.Class type)
collection - The java.util.Collection object to be wrappedtype - The type of the objects you can add
public static java.util.List typeSafeList(java.util.List list,
java.lang.Class type)
list - The java.util.List object to be wrappedtype - The type of the objects you can add
public static java.util.Set typeSafeSet(java.util.Set set,
java.lang.Class type)
set - The java.util.Set object to be wrappedtype - The type of the objects you can add
public static java.util.SortedSet typeSafeSortedSet(java.util.SortedSet set,
java.lang.Class type)
set - The java.util.SortedSet object to be wrappedtype - The type of the objects you can add
public static java.util.Map typeSafeMap(java.util.Map map,
java.lang.Class keyType,
java.lang.Class valueType)
map - The java.util.Map object to be wrappedkeyType - The type of the objects you use as keysvalueType - The type of the objects you add as values
public static java.util.SortedMap typeSafeSortedMap(java.util.SortedMap map,
java.lang.Class keyType,
java.lang.Class valueType)
map - The java.util.SortedMap object to be wrappedkeyType - The type of the objects you use as keysvalueType - The type of the objects you add as values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||