Class MinimalCollection<E>
java.lang.Object
java.util.AbstractCollection<E>
com.google.common.collect.testing.MinimalCollection<E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
- Direct Known Subclasses:
MinimalSet
A simplistic collection which implements only the bare minimum allowed by the
spec, and throws exceptions whenever it can.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAll
(Collection<? extends E> elementsToAdd) void
clear()
boolean
boolean
containsAll
(Collection<?> collection) iterator()
static <E> MinimalCollection
<E> of
(E... contents) static <E> MinimalCollection
<E> ofClassAndContents
(Class<? super E> type, E... contents) boolean
removeAll
(Collection<?> elementsToRemove) boolean
retainAll
(Collection<?> elementsToRetain) int
size()
Object[]
toArray()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Method Details
-
of
-
ofClassAndContents
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in classAbstractCollection<E>
-
contains
- Specified by:
contains
in interfaceCollection<E>
- Overrides:
contains
in classAbstractCollection<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Overrides:
containsAll
in classAbstractCollection<E>
-
iterator
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<E>
-
toArray
- Specified by:
toArray
in interfaceCollection<E>
- Overrides:
toArray
in classAbstractCollection<E>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Overrides:
addAll
in classAbstractCollection<E>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Overrides:
removeAll
in classAbstractCollection<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Overrides:
retainAll
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Overrides:
clear
in classAbstractCollection<E>
-