edu.rice.cs.plt.collect
Class ImmutableSet<T>
java.lang.Object
java.util.AbstractCollection<T>
edu.rice.cs.plt.collect.ImmutableCollection<T>
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 extends T>),
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 extends T>)
(see AbstractCollection for details on the default implementations).
- See Also:
- Serialized Form
|
Method Summary |
boolean |
equals(Object o)
|
int |
hashCode()
|
static
|
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 interface java.util.Set |
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ImmutableSet
public ImmutableSet(Set<? extends T> set)
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).