|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.python.util.Generic
public class Generic
Static methods to make instances of collections with their generic types inferred from what
they're being assigned to. The idea is stolen from Sets, Lists and
Maps from Google
Collections.
| Field Summary | |
|---|---|
static int |
CHM_CONCURRENCY_LEVEL
|
static int |
CHM_INITIAL_CAPACITY
Our default ConcurrentHashMap sizes. |
static float |
CHM_LOAD_FACTOR
|
| Constructor Summary | |
|---|---|
Generic()
|
|
| Method Summary | ||
|---|---|---|
static
|
concurrentMap()
Makes a ConcurrentMap using generic types inferred from whatever this is being assigned to. |
|
static
|
concurrentSet()
Makes a Set, ensuring safe concurrent operations, using generic types inferred from whatever this is being assigned to. |
|
static
|
list()
Makes a List with its generic type inferred from whatever it's being assigned to. |
|
static
|
list(U... contents)
Makes a List with its generic type inferred from whatever it's being assigned to filled with the items in contents. |
|
static
|
map()
Makes a Map using generic types inferred from whatever this is being assigned to. |
|
static
|
newSetFromMap(Map<E,Boolean> map)
Return a Set backed by the specified Map with the same ordering, concurrency and performance characteristics. |
|
static
|
set()
Makes a Set using the generic type inferred from whatever this is being assigned to. |
|
static
|
set(U... contents)
Makes a Set using the generic type inferred from whatever this is being assigned to filled with the items in contents. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CHM_INITIAL_CAPACITY
public static final float CHM_LOAD_FACTOR
public static final int CHM_CONCURRENCY_LEVEL
| Constructor Detail |
|---|
public Generic()
| Method Detail |
|---|
public static <T> List<T> list()
public static <T,U extends T> List<T> list(U... contents)
contents.
public static <K,V> Map<K,V> map()
public static <K,V> ConcurrentMap<K,V> concurrentMap()
public static <E> Set<E> set()
public static <T,U extends T> Set<T> set(U... contents)
contents.
public static <E> Set<E> concurrentSet()
public static <E> Set<E> newSetFromMap(Map<E,Boolean> map)
map - the backing Map
IllegalArgumentException - if Map is not empty
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||