-
- Type Parameters:
E
-
- All Superinterfaces:
java.util.Collection<E>
,java.lang.Iterable<E>
,java.util.List<E>
,PCollection<E>
- All Known Implementing Classes:
ConsPStack
,TreePVector
public interface PSequence<E> extends PCollection<E>, java.util.List<E>
An immutable, persistent indexed collection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
add(int index, E element)
Deprecated.boolean
addAll(int index, java.util.Collection<? extends E> c)
Deprecated.PSequence<E>
minus(int i)
PSequence<E>
minus(java.lang.Object e)
Returns a sequence consisting of the elements of this without the first occurrence of e.PSequence<E>
minusAll(java.util.Collection<?> list)
PSequence<E>
plus(int i, E e)
PSequence<E>
plus(E e)
PSequence<E>
plusAll(int i, java.util.Collection<? extends E> list)
PSequence<E>
plusAll(java.util.Collection<? extends E> list)
E
remove(int index)
Deprecated.E
set(int index, E element)
Deprecated.PSequence<E>
subList(int start, int end)
PSequence<E>
with(int i, E e)
-
-
-
Method Detail
-
plus
PSequence<E> plus(E e)
- Specified by:
plus
in interfacePCollection<E>
- Returns:
- a collection which contains e and all of the elements of this
-
plusAll
PSequence<E> plusAll(java.util.Collection<? extends E> list)
- Specified by:
plusAll
in interfacePCollection<E>
- Returns:
- a collection which contains all of the elements of list and this
-
with
PSequence<E> with(int i, E e)
- Parameters:
i
-e
-- Returns:
- a sequence consisting of the elements of this with e replacing the element at index i.
- Throws:
IndexOutOfBOundsException
- if i<0 || i>=this.size()
-
plus
PSequence<E> plus(int i, E e)
- Parameters:
i
-e
-- Returns:
- a sequence consisting of the elements of this with e inserted at index i.
- Throws:
IndexOutOfBOundsException
- if i<0 || i>this.size()
-
plusAll
PSequence<E> plusAll(int i, java.util.Collection<? extends E> list)
- Parameters:
i
-list
-- Returns:
- a sequence consisting of the elements of this with list inserted at index i.
- Throws:
IndexOutOfBOundsException
- if i<0 || i>this.size()
-
minus
PSequence<E> minus(java.lang.Object e)
Returns a sequence consisting of the elements of this without the first occurrence of e.- Specified by:
minus
in interfacePCollection<E>
- Returns:
- this with a single instance of e removed, if e is in this
-
minusAll
PSequence<E> minusAll(java.util.Collection<?> list)
- Specified by:
minusAll
in interfacePCollection<E>
- Returns:
- this with all elements of list completely removed
-
minus
PSequence<E> minus(int i)
- Parameters:
i
-- Returns:
- a sequence consisting of the elements of this with the element at index i removed.
- Throws:
IndexOutOfBOundsException
- if i<0 || i>=this.size()
-
subList
PSequence<E> subList(int start, int end)
- Specified by:
subList
in interfacejava.util.List<E>
-
addAll
@Deprecated boolean addAll(int index, java.util.Collection<? extends E> c)
Deprecated.- Specified by:
addAll
in interfacejava.util.List<E>
-
set
@Deprecated E set(int index, E element)
Deprecated.- Specified by:
set
in interfacejava.util.List<E>
-
add
@Deprecated void add(int index, E element)
Deprecated.- Specified by:
add
in interfacejava.util.List<E>
-
-