org.pcollections
Class OrderedPSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
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>
Methods inherited from class java.util.AbstractCollection |
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString |
Methods inherited from interface java.util.Set |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
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.