com.google.common.collect.testing
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
@GwtCompatible
public class MinimalCollection<E>
- extends AbstractCollection<E>
A simplistic collection which implements only the bare minimum allowed by the
spec, and throws exceptions whenever it can.
- Author:
- Kevin Bourrillion
of
public static <E> MinimalCollection<E> of(E... contents)
ofClassAndContents
public static <E> MinimalCollection<E> ofClassAndContents(Class<? super E> type,
E... contents)
size
public int size()
- Specified by:
size in interface Collection<E>- Specified by:
size in class AbstractCollection<E>
contains
public boolean contains(Object object)
- Specified by:
contains in interface Collection<E>- Overrides:
contains in class AbstractCollection<E>
containsAll
public boolean containsAll(Collection<?> collection)
- Specified by:
containsAll in interface Collection<E>- Overrides:
containsAll in class AbstractCollection<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>- Specified by:
iterator in class AbstractCollection<E>
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection<E>- Overrides:
toArray in class AbstractCollection<E>
addAll
public boolean addAll(Collection<? extends E> elementsToAdd)
- Specified by:
addAll in interface Collection<E>- Overrides:
addAll in class AbstractCollection<E>
removeAll
public boolean removeAll(Collection<?> elementsToRemove)
- Specified by:
removeAll in interface Collection<E>- Overrides:
removeAll in class AbstractCollection<E>
retainAll
public boolean retainAll(Collection<?> elementsToRetain)
- Specified by:
retainAll in interface Collection<E>- Overrides:
retainAll in class AbstractCollection<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Overrides:
clear in class AbstractCollection<E>
Copyright © 2010-2013. All Rights Reserved.