edu.rice.cs.plt.collect
Class ImmutableSet<T>

java.lang.Object
  extended by java.util.AbstractCollection<T>
      extended by edu.rice.cs.plt.collect.ImmutableCollection<T>
          extended by edu.rice.cs.plt.collect.ImmutableSet<T>
All Implemented Interfaces:
PredicateSet<T>, SizedIterable<T>, Predicate<Object>, Composite, Serializable, Iterable<T>, Collection<T>, Set<T>

public class ImmutableSet<T>
extends ImmutableCollection<T>
implements PredicateSet<T>

Wraps a set in an immutable interface. Similar to Collections.unmodifiableSet(java.util.Set), but this class also implements PredicateSet and allows subclassing. Subclasses can invoke the overridden methods in AbstractCollection to use the default implementations there by invoking, for example, ImmutableCollection.abstractCollectionAddAll(java.util.Collection) (see AbstractCollection for details on the default implementations).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.rice.cs.plt.collect.ImmutableCollection
_delegate
 
Constructor Summary
ImmutableSet(Set<? extends T> set)
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
static
<T> ImmutableSet<T>
make(Set<? extends T> set)
          Call the constructor (allows T to be inferred).
 
Methods inherited from class edu.rice.cs.plt.collect.ImmutableCollection
abstractCollectionAddAll, abstractCollectionClear, abstractCollectionContains, abstractCollectionContainsAll, abstractCollectionIsEmpty, abstractCollectionRemove, abstractCollectionRemoveAll, abstractCollectionRetainAll, abstractCollectionToArray, abstractCollectionToArray, add, addAll, clear, compositeHeight, compositeSize, contains, containsAll, hasFixedSize, isEmpty, isInfinite, isStatic, iterator, make, remove, removeAll, retainAll, size, size, toArray, 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
 
Methods inherited from interface edu.rice.cs.plt.lambda.Predicate
contains
 
Methods inherited from interface edu.rice.cs.plt.iter.SizedIterable
hasFixedSize, isEmpty, isInfinite, isStatic, size, size
 

Constructor Detail

ImmutableSet

public ImmutableSet(Set<? extends T> set)
Method Detail

equals

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

hashCode

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

make

public static <T> ImmutableSet<T> make(Set<? extends T> set)
Call the constructor (allows T to be inferred).