org.javimmutable.collections.common
Class SetAdaptor<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<T>
          extended by org.javimmutable.collections.common.SetAdaptor<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>, Collection<T>, Set<T>

@Immutable
public class SetAdaptor<T>
extends AbstractSet<T>

Adaptor that implements an unmodifiable Set backed by a PersistentSet.


Constructor Summary
SetAdaptor(JImmutableSet<T> pset)
           
 
Method Summary
static
<T> boolean
areEqual(Set<T> a, Set<T> b)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> objects)
           
 Iterator<T> iterator()
           
static
<T> SetAdaptor<T>
of(JImmutableSet<T> pset)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, isEmpty, remove, retainAll, 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, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

SetAdaptor

public SetAdaptor(JImmutableSet<T> pset)
Method Detail

of

public static <T> SetAdaptor<T> of(JImmutableSet<T> pset)

contains

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

containsAll

public boolean containsAll(Collection<?> objects)
Specified by:
containsAll in interface Collection<T>
Specified by:
containsAll in interface Set<T>
Overrides:
containsAll in class AbstractCollection<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>
Specified by:
iterator in interface Collection<T>
Specified by:
iterator in interface Set<T>
Specified by:
iterator in class AbstractCollection<T>

size

public int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface Set<T>
Specified by:
size in class AbstractCollection<T>

areEqual

public static <T> boolean areEqual(Set<T> a,
                                   Set<T> b)


Copyright © 2014 Burton Computer Corporation. All rights reserved.