|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.CollectionUtils
Collection of useful static methods for working with Collections. Includes methods to increment counts in maps and cast list/map elements to common types.
Method Summary | |
static boolean |
getBoolean(List list,
int index)
Returns ((Boolean)list.get(index)).booleanValue(). |
static boolean |
getBoolean(Map map,
Object key)
Returns ((Boolean)map.get(key)).booleanValue(). |
static double |
getdouble(List list,
int index)
Returns ((Double)list.get(index)).doubleValue(). |
static Double |
getDouble(List list,
int index)
Returns (Double)list.get(index). |
static double |
getdouble(Map map,
Object key)
Returns ((Double)map.get(key)).doubleValue(). |
static Double |
getDouble(Map map,
Object key)
Returns (Double)map.get(key). |
static int |
getInt(List list,
int index)
Returns ((Integer)list.get(index)).intValue(). |
static int |
getInt(Map list,
Object key)
Returns ((Integer)map.get(key)).intValue(). |
static Integer |
getInteger(List list,
int index)
Returns (Integer)list.get(index). |
static Integer |
getInteger(Map map,
Object key)
Returns (Integer)map.get(key). |
static String |
getString(List list,
int index)
Returns (String)list.get(index). |
static String |
getString(Map map,
Object key)
Returns (String)map.get(key). |
static boolean |
incrementCount(Map map,
Object key)
Increments the Integer count of the given key in the given Map by 1. |
static boolean |
incrementCount(Map map,
Object key,
int delta)
Adds the given delta to the Integer value stored for the given key in the given Map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean incrementCount(Map map, Object key, int delta)
map
- Map from keys to Integer values representing key countskey
- key in map for Integer to incrementdelta
- amount to change Integer value count by
public static boolean incrementCount(Map map, Object key)
incrementCount(Map,Object,int)
public static String getString(List list, int index)
public static Integer getInteger(List list, int index)
public static int getInt(List list, int index)
public static Double getDouble(List list, int index)
public static double getdouble(List list, int index)
public static boolean getBoolean(List list, int index)
public static String getString(Map map, Object key)
public static Integer getInteger(Map map, Object key)
public static int getInt(Map list, Object key)
public static Double getDouble(Map map, Object key)
public static double getdouble(Map map, Object key)
public static boolean getBoolean(Map map, Object key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |