com.google.common.collect.testing
Class MinimalSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by com.google.common.collect.testing.MinimalCollection<E>
          extended by com.google.common.collect.testing.MinimalSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>

public class MinimalSet<E>
extends MinimalCollection<E>
implements Set<E>

A simplistic set which implements the bare minimum so that it can be used in tests without relying on any specific Set implementations. Slow. Explicitly allows null elements so that they can be used in the testers.

This class is GWT compatible.

Author:
Regina O'Dell

Method Summary
 boolean equals(Object object)
           
static
<E> MinimalSet<E>
from(Collection<? extends E> contents)
           
 int hashCode()
           
static
<E> MinimalSet<E>
of(E... contents)
           
static
<E> MinimalSet<E>
ofClassAndContents(Class<? super E> type, E[] emptyArrayForContents, Iterable<? extends E> contents)
           
 
Methods inherited from class com.google.common.collect.testing.MinimalCollection
addAll, clear, contains, containsAll, iterator, ofClassAndContents, removeAll, retainAll, size, toArray
 
Methods inherited from class java.util.AbstractCollection
add, isEmpty, remove, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

of

public static <E> MinimalSet<E> of(E... contents)

from

public static <E> MinimalSet<E> from(Collection<? extends E> contents)

ofClassAndContents

public static <E> MinimalSet<E> ofClassAndContents(Class<? super E> type,
                                                   E[] emptyArrayForContents,
                                                   Iterable<? extends E> contents)

equals

public boolean equals(Object object)
Specified by:
equals in interface Collection<E>
Specified by:
equals in interface Set<E>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface Set<E>
Overrides:
hashCode in class Object


Copyright © 2010-2011. All Rights Reserved.