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
ModifierConstructorDescriptionprotected
TransformCollection
(Collection<W> wrapped, Transformer<E, W> transformer) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
protected Collection
<W> int
hashCode()
boolean
isEmpty()
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.boolean
boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class com.aoapps.collections.transformers.TransformIterable
forEach, iterator, of, of
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
iterator, parallelStream, spliterator, stream, toArray
-
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:
getWrapped
in classTransformIterable<E,
W>
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
-
toArray
- Specified by:
toArray
in interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<E>
-
add
- Specified by:
add
in interfaceCollection<E>
-
remove
- Specified by:
remove
in interfaceCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
-
equals
- Specified by:
equals
in interfaceCollection<E>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<E>
- Overrides:
hashCode
in classObject
-