org.pcollections
Class OrderedPSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by org.pcollections.OrderedPSet<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, PCollection<E>, POrderedSet<E>, PSet<E>

public class OrderedPSet<E>
extends AbstractSet<E>
implements POrderedSet<E>


Method Summary
static
<E> OrderedPSet<E>
empty()
           
static
<E> OrderedPSet<E>
from(Collection<? extends E> list)
           
 E get(int index)
           
 int indexOf(Object o)
           
 Iterator<E> iterator()
           
 OrderedPSet<E> minus(Object e)
           
 OrderedPSet<E> minusAll(Collection<?> list)
           
 OrderedPSet<E> plus(E e)
           
 OrderedPSet<E> plusAll(Collection<? extends E> list)
           
static
<E> OrderedPSet<E>
singleton(E e)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, 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 org.pcollections.PCollection
add, addAll, clear, remove, removeAll, retainAll
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Method Detail

empty

public static <E> OrderedPSet<E> empty()

from

public static <E> OrderedPSet<E> from(Collection<? extends E> list)

singleton

public static <E> OrderedPSet<E> singleton(E e)

plus

public OrderedPSet<E> plus(E e)
Specified by:
plus in interface PCollection<E>
Specified by:
plus in interface POrderedSet<E>
Specified by:
plus in interface PSet<E>
Parameters:
e - non-null
Returns:
a collection which contains e and all of the elements of this

plusAll

public OrderedPSet<E> plusAll(Collection<? extends E> list)
Specified by:
plusAll in interface PCollection<E>
Specified by:
plusAll in interface POrderedSet<E>
Specified by:
plusAll in interface PSet<E>
Parameters:
list - contains no null elements
Returns:
a collection which contains all of the elements of list and this

minus

public OrderedPSet<E> minus(Object e)
Specified by:
minus in interface PCollection<E>
Specified by:
minus in interface POrderedSet<E>
Specified by:
minus in interface PSet<E>
Returns:
this with a single instance of e removed, if e is in this

minusAll

public OrderedPSet<E> minusAll(Collection<?> list)
Specified by:
minusAll in interface PCollection<E>
Specified by:
minusAll in interface POrderedSet<E>
Specified by:
minusAll in interface PSet<E>
Returns:
this with all elements of list completely removed

iterator

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

size

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

get

public E get(int index)
Specified by:
get in interface POrderedSet<E>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface POrderedSet<E>


Copyright © 2011. All Rights Reserved.