org.python.util
Class Generic

java.lang.Object
  extended by org.python.util.Generic

public class Generic
extends java.lang.Object

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.


Constructor Summary
Generic()
           
 
Method Summary
static
<T> java.util.List<T>
list()
          Makes a List with its generic type inferred from whatever its being assigned to.
static
<K,V> java.util.Map<K,V>
map()
          Makes a Map using generic types inferred from whatever this is being assigned to.
static
<T> java.util.Set<T>
set()
          Makes a Set using the generic type inferred from whatever this is being assigned to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generic

public Generic()
Method Detail

list

public static <T> java.util.List<T> list()
Makes a List with its generic type inferred from whatever its being assigned to.


map

public static <K,V> java.util.Map<K,V> map()
Makes a Map using generic types inferred from whatever this is being assigned to.


set

public static <T> java.util.Set<T> set()
Makes a Set using the generic type inferred from whatever this is being assigned to.



Jython homepage