Package org.biojava.utils
Class ListTools
- java.lang.Object
-
- org.biojava.utils.ListTools
-
- All Implemented Interfaces:
java.io.Serializable
public class ListTools extends java.lang.Object implements java.io.Serializable- Author:
- Matthew Pocock, Thomas Down, Mark Schreiber
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListTools.Doubletstatic interfaceListTools.MapperMaps one object to another.static classListTools.SeriesListA list that represents a series of values.static classListTools.Triplet
-
Field Summary
Fields Modifier and Type Field Description static ListTools.MapperNULL_MAPPER
-
Constructor Summary
Constructors Constructor Description ListTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.ListcreateList(java.lang.Object[] a)static java.util.ListcreateList(java.util.List l)static ListTools.SeriesListcreateSeriesList(java.lang.String leader, java.lang.String trailer, int size)Create a new SeriesList with the given leader, trailer and size.static java.util.ListmapList(java.util.List list, ListTools.Mapper mapper)static java.util.MapmapMap(java.util.Map map, ListTools.Mapper keyMapper, ListTools.Mapper valMapper)static java.util.SetmapSet(java.util.Set set, ListTools.Mapper mapper)static java.util.IteratornonRemoveIterator(java.util.Iterator i)
-
-
-
Field Detail
-
NULL_MAPPER
public static final ListTools.Mapper NULL_MAPPER
-
-
Method Detail
-
nonRemoveIterator
public static java.util.Iterator nonRemoveIterator(java.util.Iterator i)
-
createList
public static java.util.List createList(java.util.List l)
-
createList
public static java.util.List createList(java.lang.Object[] a)
-
createSeriesList
public static ListTools.SeriesList createSeriesList(java.lang.String leader, java.lang.String trailer, int size)
Create a new SeriesList with the given leader, trailer and size.- Parameters:
leader- the String that will prefix the indextrailer- the String that will suffix the indexsize- the length of the list- Throws:
java.lang.NullPointerException- if leader or trailer are null (use the empty string instead)java.lang.IllegalArgumentException- if the size is negative
-
mapList
public static java.util.List mapList(java.util.List list, ListTools.Mapper mapper)
-
mapSet
public static java.util.Set mapSet(java.util.Set set, ListTools.Mapper mapper)
-
mapMap
public static java.util.Map mapMap(java.util.Map map, ListTools.Mapper keyMapper, ListTools.Mapper valMapper)
-
-