r01f.util.types
Class Lists

java.lang.Object
  extended by r01f.util.types.Lists

public class Lists
extends java.lang.Object


Constructor Summary
Lists()
           
 
Method Summary
static boolean isNullOrEmpty(java.util.List<?> list)
          Checks if a list is null or empty
static
<E> java.util.List<E>
newArrayList()
          Creates a mutable, empty ArrayList instance.
static
<E> java.util.List<E>
newArrayList(E... elements)
          Creates a mutable ArrayList instance containing the given elements.
static
<E> java.util.List<E>
newArrayList(java.lang.Iterable<? extends E> elements)
          Creates a mutable ArrayList instance containing the given elements.
static
<E> java.util.List<E>
newArrayList(java.util.Iterator<? extends E> elements)
          Creates a mutable ArrayList instance containing the given elements.
static
<E> java.util.List<E>
newArrayListWithCapacity(int size)
          Creates an ArrayList instance backed by an array of the exact size specified; equivalent to ArrayList.ArrayList(int).
static
<E> java.util.List<E>
newLinkedList()
          Creates an empty LinkedList instance.
static
<E> java.util.List<E>
newLinkedList(java.lang.Iterable<? extends E> elements)
          Creates a LinkedList instance containing the given elements.
static
<E> java.util.LinkedList<E>
newLinkedList(java.util.Iterator<? extends E> elements)
          Creates a LinkedList instance containing the given elements.
static
<E> java.util.List<java.util.List<E>>
partition(java.util.List<E> list, int size)
          Returns consecutive sublists of a list, each of the same size (the final list may be smaller).
static
<E> java.util.List<E>
reverse(java.util.List<E> list)
          Returns a reversed view of the specified list.
static
<E,T> java.util.List<T>
transform(java.util.List<E> fromList, com.google.common.base.Function<? super E,? extends T> function)
          Returns a list that applies function to each element of fromList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lists

public Lists()
Method Detail

isNullOrEmpty

public static boolean isNullOrEmpty(java.util.List<?> list)
Checks if a list is null or empty


newArrayList

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newArrayList(E... elements)
Creates a mutable ArrayList instance containing the given elements.


newArrayList

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newArrayList(java.lang.Iterable<? extends E> elements)
Creates a mutable ArrayList instance containing the given elements.


newArrayList

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newArrayList(java.util.Iterator<? extends E> elements)
Creates a mutable ArrayList instance containing the given elements.


newArrayList

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newArrayList()
Creates a mutable, empty ArrayList instance.


newArrayListWithCapacity

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newArrayListWithCapacity(int size)
Creates an ArrayList instance backed by an array of the exact size specified; equivalent to ArrayList.ArrayList(int).


newLinkedList

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newLinkedList()
Creates an empty LinkedList instance.


newLinkedList

@GwtCompatible(serializable=true)
public static <E> java.util.List<E> newLinkedList(java.lang.Iterable<? extends E> elements)
Creates a LinkedList instance containing the given elements.


newLinkedList

@GwtCompatible(serializable=true)
public static <E> java.util.LinkedList<E> newLinkedList(java.util.Iterator<? extends E> elements)
Creates a LinkedList instance containing the given elements.


partition

public static <E> java.util.List<java.util.List<E>> partition(java.util.List<E> list,
                                                              int size)
Returns consecutive sublists of a list, each of the same size (the final list may be smaller).


reverse

public static <E> java.util.List<E> reverse(java.util.List<E> list)
Returns a reversed view of the specified list.


transform

public static <E,T> java.util.List<T> transform(java.util.List<E> fromList,
                                                com.google.common.base.Function<? super E,? extends T> function)
Returns a list that applies function to each element of fromList.