|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.agilecoders.wicket.jquery.util.Generics2
public final class Generics2
helper class to handle creation/transformation/filtering of collections. This class is used to wrap guava. Future releases of bootstrap won't depend on guava anymore.
| Method Summary | ||
|---|---|---|
static
|
filter(Iterable<T> unfiltered,
com.google.common.base.Predicate<T> filter)
Returns the elements of unfiltered that satisfy given filter. |
|
static String |
join(Iterable<?> elements,
char separator)
joins all given elements with a special separator |
|
static
|
newArrayList(Iterable<? extends T> elements)
creates a new ArrayList from given array of elements. |
|
static
|
newArrayList(Iterator<? extends T> elements)
Creates a mutable ArrayList instance containing the given
elements. |
|
static
|
newArrayList(T... elements)
creates a new ArrayList from given array of elements. |
|
static
|
newHashSet(T... elements)
creates a new HashSet from given array of elements. |
|
static
|
newLinkedHashSet(Iterable<? extends T> elements)
creates a new LinkedHashSet from given array of elements. |
|
static List<String> |
split(CharSequence value,
String separator)
splits a CharSequence by given separator. |
|
static
|
transform(List<P> elements,
com.google.common.base.Function<P,R> transformer)
Returns a list that applies transformer to each element of elements |
|
static
|
transform(P[] elements,
com.google.common.base.Function<P,R> transformer)
Returns a list that applies transformer to each element of elements |
|
static
|
transform(Set<P> elements,
com.google.common.base.Function<P,R> transformer)
Returns a list that applies transformer to each element of elements |
|
static
|
transform(T[] elements)
transform an array of elements into a list of elements |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> ArrayList<T> newArrayList(T... elements)
ArrayList from given array of elements.
T - the type of all elements inside the listelements - the elements to add to new ArrayList
ArrayList that contains all given elements
IllegalArgumentException - if given array of elements is nullpublic static <T> ArrayList<T> newArrayList(Iterator<? extends T> elements)
ArrayList instance containing the given
elements.
elements - the elements that the list should contain, in order
ArrayList containing those elementspublic static <T> ArrayList<T> newArrayList(Iterable<? extends T> elements)
ArrayList from given array of elements.
T - the type of all elements inside the listelements - the elements to add to new ArrayList
ArrayList that contains all given elements
IllegalArgumentException - if given array of elements is nullpublic static <T> Set<T> newLinkedHashSet(Iterable<? extends T> elements)
LinkedHashSet from given array of elements.
T - the type of all elements inside the setelements - the elements to add to new LinkedHashSet
LinkedHashSet that contains all given elements
IllegalArgumentException - if given array of elements is nullpublic static <T> Set<T> newHashSet(T... elements)
HashSet from given array of elements.
T - the type of all elements inside the setelements - the elements to add to new HashSet
HashSet that contains all given elements
IllegalArgumentException - if given array of elements is null
public static String join(Iterable<?> elements,
char separator)
elements - elements to joinseparator - separator to use
public static <T> List<T> transform(T[] elements)
T - the type of elementselements - the elements to add to list
public static <P,R> List<R> transform(List<P> elements,
com.google.common.base.Function<P,R> transformer)
transformer to each element of elements
public static <P,R> Set<R> transform(Set<P> elements,
com.google.common.base.Function<P,R> transformer)
transformer to each element of elements
public static <P,R> List<R> transform(P[] elements,
com.google.common.base.Function<P,R> transformer)
transformer to each element of elements
public static <T> List<T> filter(Iterable<T> unfiltered,
com.google.common.base.Predicate<T> filter)
unfiltered that satisfy given filter. The
resulting iterable's iterator does not support remove().
public static List<String> split(CharSequence value,
String separator)
CharSequence by given separator.
value - the value to splitseparator - the separator to use to split value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||