Class TransformCollection<E,W>
java.lang.Object
com.aoapps.collections.transformers.TransformIterable<E,W>
com.aoapps.collections.transformers.TransformCollection<E,W>
- All Implemented Interfaces:
Iterable<E>,Collection<E>
- Direct Known Subclasses:
TransformList,TransformQueue,TransformSet
Wraps a
Collection, with optional type conversion.- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class com.aoapps.collections.transformers.TransformIterable
transformer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTransformCollection(Collection<W> wrapped, Transformer<E, W> transformer) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanprotected Collection<W> inthashCode()booleanisEmpty()static <E> TransformCollection<E, E> of(Collection<E> collection) static <E,W> TransformCollection <E, W> of(Collection<W> collection, Transformer<E, W> transformer) Wraps a collection.booleanbooleanremoveAll(Collection<?> c) booleanbooleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(IntFunction<T[]> generator) <T> T[]toArray(T[] a) Methods inherited from class com.aoapps.collections.transformers.TransformIterable
forEach, iterator, of, ofMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
iterator, parallelStream, spliterator, stream
-
Constructor Details
-
TransformCollection
-
-
Method Details
-
of
public static <E,W> TransformCollection<E,W> of(Collection<W> collection, Transformer<E, W> transformer) Wraps a collection.- If the given collection is a
List, then will return aTransformList. - If the given collection is a
Queue, then will return aTransformQueue. - If the given collection is a
Set, then will return aTransformSet.
- See Also:
- If the given collection is a
-
of
- See Also:
-
getWrapped
- Overrides:
getWrappedin classTransformIterable<E,W>
-
size
public int size()- Specified by:
sizein interfaceCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>
-
contains
- Specified by:
containsin interfaceCollection<E>
-
toArray
- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<E>
-
toArray
- Specified by:
toArrayin interfaceCollection<E>
-
add
- Specified by:
addin interfaceCollection<E>
-
remove
- Specified by:
removein interfaceCollection<E>
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>
-
removeIf
- Specified by:
removeIfin interfaceCollection<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>
-
equals
- Specified by:
equalsin interfaceCollection<E>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Overrides:
hashCodein classObject
-
