public final class OldCollections extends Object
| Modifier and Type | Method and Description |
|---|---|
static <C extends Collection<? super E>,E> |
addArray(C collection,
E... elements) |
static <C extends Collection<T>,T> |
addBatch(C c,
Iterable<T> elements) |
static <C extends Collection<T>,T> |
append(C collectionToEnhance,
Predicate<? super T> selectionPredicate,
Iterable<T> collectionToAppend) |
static <C extends Collection<T>,T> |
append(C collectionToEnhance,
Predicate<? super T> selectionPredicate,
Iterator<T> iterator) |
static <C extends Collection<T>,T> |
append(C collectionToEnhance,
Predicate<? super T> selectionPredicate,
T[] arrayToAppend) |
static StringBuilder |
appendArray(StringBuilder sb,
Object... elements) |
static StringBuilder |
appendArraySeperated(StringBuilder sb,
char elementSeperator,
Object... elements) |
static StringBuilder |
appendArraySeperated(StringBuilder sb,
String elementSeperator,
Object... elements) |
static StringBuilder |
appendIterable(StringBuilder sb,
Iterable<?> iterable) |
static StringBuilder |
appendIterableSeperated(StringBuilder sb,
char elementSeperator,
Iterable<?> iterable) |
static StringBuilder |
appendIterableSeperated(StringBuilder sb,
String elementSeperator,
Iterable<?> iterable) |
static <E> ArrayList<E> |
ArrayList(E... elements) |
static <T> ArrayList<T> |
ArrayList(int initialCapacity,
Iterable<T> elements) |
static <E> ArrayList<E> |
ArrayList(XGettingCollection<? extends E> xCollection)
Convenience method for
new ArrayList<E>(xCollection). |
static <T,L extends List<T> & RandomAccess> |
containsSearched(L list,
Predicate<? super T> predicate) |
static <T,L extends List<T> & RandomAccess> |
count(L list,
Predicate<? super T> predicate) |
static <T> ArrayList<T> |
filter(ArrayList<T> arrayList,
Predicate<? super T> selectionPredicate) |
static <C extends Collection<T>,T> |
filter(C sourceCollection,
Predicate<? super T> selectionPredicate,
C target) |
static <T,L extends List<T> & RandomAccess> |
filter(L list,
Predicate<? super T> selectionPredicate,
L targetList) |
static <E> LinkedList<E> |
LinkedList(E... elements) |
static <E> LinkedList<E> |
LinkedList(XGettingCollection<? extends E> xCollection) |
static <K,V,T extends Map<K,V>,S extends Map<? extends K,? extends V>> |
mergeInto(T target,
S... maps) |
static <K,V> HashMap<K,V> |
OldHashMap(KeyValue<? extends K,? extends V>... keyValueTuples) |
static <T> HashSet<T> |
OldHashSet(T... elements) |
static <K,V> LinkedHashMap<K,V> |
OldLinkedHashMap(XGettingMap<K,V> map) |
static void |
populateCollection(Collection<Object> instance,
Object[] elements) |
static void |
populateCollectionFromHelperArray(Collection<?> instance,
Object elementsHelper) |
static void |
populateMap(Map<Object,Object> instance,
Object[] elements) |
static void |
populateMapFromHelperArray(Map<?,?> instance,
Object elementsHelper) |
static <T> ArrayList<T> |
reduce(ArrayList<T> arrayList,
Predicate<? super T> reductionPredicate) |
static <C extends Collection<T>,T> |
reduce(C collection,
Predicate<? super T> reductionPredicate)
Reduces
collection by all elements that meet reductionPredicate.Note that NO new collection instance is created but the collection itself is reduced. |
static <T,L extends List<T> & RandomAccess> |
search(L list,
Predicate<? super T> predicate) |
static StringBuilder |
stringBuilder(Object... elements) |
static StringBuilder |
stringBuilderSeperated(char elementSeperator,
Object... elements) |
static StringBuilder |
stringBuilderSeperated(String elementSeperator,
Object... elements) |
static <T> T[] |
toArray(Collection<? extends T> collection,
Class<T> elementType)
Alias for the annoying
collection.toArray((T[])Array.newInstance(elementType, collection.size())) |
public static final <C extends Collection<T>,T> C addBatch(C c, Iterable<T> elements)
@SafeVarargs public static final <C extends Collection<? super E>,E> C addArray(C collection, E... elements)
@SafeVarargs public static final <E> ArrayList<E> ArrayList(E... elements)
@SafeVarargs public static final <E> LinkedList<E> LinkedList(E... elements)
public static final <E> LinkedList<E> LinkedList(XGettingCollection<? extends E> xCollection)
@SafeVarargs public static <K,V,T extends Map<K,V>,S extends Map<? extends K,? extends V>> T mergeInto(T target, S... maps)
public static final <T,L extends List<T> & RandomAccess> int count(L list, Predicate<? super T> predicate)
public static final <T,L extends List<T> & RandomAccess> T search(L list, Predicate<? super T> predicate)
public static final <T,L extends List<T> & RandomAccess> boolean containsSearched(L list, Predicate<? super T> predicate)
public static <C extends Collection<T>,T> C append(C collectionToEnhance, Predicate<? super T> selectionPredicate, T[] arrayToAppend)
public static <C extends Collection<T>,T> C append(C collectionToEnhance, Predicate<? super T> selectionPredicate, Iterator<T> iterator)
public static <C extends Collection<T>,T> C append(C collectionToEnhance, Predicate<? super T> selectionPredicate, Iterable<T> collectionToAppend)
public static <T> ArrayList<T> filter(ArrayList<T> arrayList, Predicate<? super T> selectionPredicate)
public static <T,L extends List<T> & RandomAccess> L filter(L list, Predicate<? super T> selectionPredicate, L targetList)
public static <C extends Collection<T>,T> C filter(C sourceCollection, Predicate<? super T> selectionPredicate, C target)
public static <T> ArrayList<T> reduce(ArrayList<T> arrayList, Predicate<? super T> reductionPredicate)
public static <C extends Collection<T>,T> C reduce(C collection, Predicate<? super T> reductionPredicate)
collection by all elements that meet reductionPredicate.C - the collection typeT - the type of the collection's elementscollection - the collection to be reducedreductionPredicate - the predicate determining which elements shall be removedcollection itselfpublic static final StringBuilder appendIterableSeperated(StringBuilder sb, String elementSeperator, Iterable<?> iterable)
public static final StringBuilder appendIterableSeperated(StringBuilder sb, char elementSeperator, Iterable<?> iterable)
public static final StringBuilder appendIterable(StringBuilder sb, Iterable<?> iterable)
public static final StringBuilder appendArraySeperated(StringBuilder sb, String elementSeperator, Object... elements)
public static final StringBuilder appendArraySeperated(StringBuilder sb, char elementSeperator, Object... elements)
public static final StringBuilder appendArray(StringBuilder sb, Object... elements)
public static final StringBuilder stringBuilderSeperated(String elementSeperator, Object... elements)
public static final StringBuilder stringBuilderSeperated(char elementSeperator, Object... elements)
public static final StringBuilder stringBuilder(Object... elements)
public static final <T> T[] toArray(Collection<? extends T> collection, Class<T> elementType)
collection.toArray((T[])Array.newInstance(elementType, collection.size()))T - the element type parameter of the listcollection - the collection whose elements shall be copied to an arrayelementType - the type of the elements contained in collection.collection.@SafeVarargs public static <T> HashSet<T> OldHashSet(T... elements)
@SafeVarargs public static <K,V> HashMap<K,V> OldHashMap(KeyValue<? extends K,? extends V>... keyValueTuples)
public static final <K,V> LinkedHashMap<K,V> OldLinkedHashMap(XGettingMap<K,V> map)
public static final <E> ArrayList<E> ArrayList(XGettingCollection<? extends E> xCollection)
new ArrayList<E>(xCollection).
E - the collection element type.xCollection - the extended collection implementation whore content shall be copied a new
ArrayList instance.ArrayList instance containing all elements of the passed XGettingCollection.public static final void populateMapFromHelperArray(Map<?,?> instance, Object elementsHelper)
public static final void populateCollectionFromHelperArray(Collection<?> instance, Object elementsHelper)
public static final void populateCollection(Collection<Object> instance, Object[] elements)
Copyright © 2022 MicroStream Software. All rights reserved.