Package org.cactoos.collection
Class CollectionEnvelope<X>
- java.lang.Object
-
- org.cactoos.iterable.IterableEnvelope<X>
-
- org.cactoos.collection.CollectionEnvelope<X>
-
- Type Parameters:
X
- Element type
- All Implemented Interfaces:
Iterable<X>
,Collection<X>
- Direct Known Subclasses:
ListEnvelope
,SetEnvelope
public abstract class CollectionEnvelope<X> extends IterableEnvelope<X> implements Collection<X>
Base collection.There is no thread-safety guarantee.
- Since:
- 0.23
-
-
Constructor Summary
Constructors Constructor Description CollectionEnvelope(Collection<X> col)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(X item)
boolean
addAll(Collection<? extends X> list)
void
clear()
boolean
contains(Object object)
boolean
containsAll(Collection<?> list)
boolean
isEmpty()
boolean
remove(Object object)
boolean
removeAll(Collection<?> list)
boolean
retainAll(Collection<?> list)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] array)
-
Methods inherited from class org.cactoos.iterable.IterableEnvelope
equals, hashCode, iterator, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, iterator, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Constructor Detail
-
CollectionEnvelope
public CollectionEnvelope(Collection<X> col)
Ctor.- Parameters:
col
- The wrapped collection
-
-
Method Detail
-
size
public final int size()
- Specified by:
size
in interfaceCollection<X>
-
isEmpty
public final boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<X>
-
contains
public final boolean contains(Object object)
- Specified by:
contains
in interfaceCollection<X>
-
toArray
public final Object[] toArray()
- Specified by:
toArray
in interfaceCollection<X>
-
toArray
public final <T> T[] toArray(T[] array)
- Specified by:
toArray
in interfaceCollection<X>
-
add
public final boolean add(X item)
- Specified by:
add
in interfaceCollection<X>
-
remove
public final boolean remove(Object object)
- Specified by:
remove
in interfaceCollection<X>
-
containsAll
public final boolean containsAll(Collection<?> list)
- Specified by:
containsAll
in interfaceCollection<X>
-
addAll
public final boolean addAll(Collection<? extends X> list)
- Specified by:
addAll
in interfaceCollection<X>
-
removeAll
public final boolean removeAll(Collection<?> list)
- Specified by:
removeAll
in interfaceCollection<X>
-
retainAll
public final boolean retainAll(Collection<?> list)
- Specified by:
retainAll
in interfaceCollection<X>
-
clear
public final void clear()
- Specified by:
clear
in interfaceCollection<X>
-
-