|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.inspera.services.pedal.utils.ICollections
public class ICollections
Utility class to create generic collections. This is usefull and makes the code somewhat cleaner when the generic types in collection
include long class names and/or include nested collections. Example:
Map<Long,Map<String,Map<Long,Long>>> myMap= new HashMap<Long,Map<String,Map<Long,Long>>>();
can be written:
Map<Long,Map<String,Map<Long,Long>>> myMap= ICollections.newMap();
which would be essentially the same, only with cleaner declaration.
Constructor Summary | |
---|---|
ICollections()
|
Method Summary | ||
---|---|---|
static
|
linkedList()
Constructs a new list. |
|
static
|
newHashMap(int initialcapacity)
Constructs an empty HashMap with the specified initial capacity and the default load factor (0.75). |
|
static
|
newHashSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection. |
|
static
|
newHashtable()
Creates a new instance of hashtable. |
|
static
|
newList()
Constructs a new list. |
|
static
|
newMap()
Creates a new instance of HashMap |
|
static
|
newSet()
Constructs a new set. |
|
static
|
newVect()
Constructs and returns a new vector. |
|
static
|
sortedMap()
|
|
static
|
synchronizedMap()
Returns a synchronized (thread-safe) map backed by the specified map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ICollections()
Method Detail |
---|
public static <K,V> java.util.Map<K,V> newMap()
public static <K,V> java.util.HashMap<K,V> newHashMap(int initialcapacity)
initialcapacity
- the initial capacity
public static <K,V> java.util.Hashtable<K,V> newHashtable()
public static <E> java.util.Set<E> newHashSet(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed into this set.
public static <E> java.util.Set<E> newSet()
public static <E> java.util.List<E> newList()
public static <E> java.util.Queue<E> linkedList()
public static <E> java.util.Vector<E> newVect()
public static <K,V> java.util.Map<K,V> synchronizedMap()
Failure to follow this advice may result in non-deterministic behavior.
The returned map will be serializable if the specified map is serializable.
public static <K,V> java.util.SortedMap<K,V> sortedMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |