Package org.biojava.utils
Class ListTools
- java.lang.Object
-
- org.biojava.utils.ListTools
-
- All Implemented Interfaces:
Serializable
public class ListTools extends Object implements Serializable
- Author:
- Matthew Pocock, Thomas Down, Mark Schreiber
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ListTools.Doublet
static interface
ListTools.Mapper
Maps one object to another.static class
ListTools.SeriesList
A list that represents a series of values.static class
ListTools.Triplet
-
Field Summary
Fields Modifier and Type Field Description static ListTools.Mapper
NULL_MAPPER
-
Constructor Summary
Constructors Constructor Description ListTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List
createList(Object[] a)
static List
createList(List l)
static ListTools.SeriesList
createSeriesList(String leader, String trailer, int size)
Create a new SeriesList with the given leader, trailer and size.static List
mapList(List list, ListTools.Mapper mapper)
static Map
mapMap(Map map, ListTools.Mapper keyMapper, ListTools.Mapper valMapper)
static Set
mapSet(Set set, ListTools.Mapper mapper)
static Iterator
nonRemoveIterator(Iterator i)
-
-
-
Field Detail
-
NULL_MAPPER
public static final ListTools.Mapper NULL_MAPPER
-
-
Constructor Detail
-
ListTools
public ListTools()
-
-
Method Detail
-
nonRemoveIterator
public static Iterator nonRemoveIterator(Iterator i)
-
createList
public static List createList(List l)
-
createList
public static List createList(Object[] a)
-
createSeriesList
public static ListTools.SeriesList createSeriesList(String leader, 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:
NullPointerException
- if leader or trailer are null (use the empty string instead)IllegalArgumentException
- if the size is negative
-
mapList
public static List mapList(List list, ListTools.Mapper mapper)
-
mapSet
public static Set mapSet(Set set, ListTools.Mapper mapper)
-
mapMap
public static Map mapMap(Map map, ListTools.Mapper keyMapper, ListTools.Mapper valMapper)
-
-