Top Description Methods
org.pcollections

public Interface PVector<E>

extends PSequence<E>
Known Direct Implementers
org.pcollections.TreePVector
Imports
java.util.Collection

An immutable, persistent list.
Author
harold

Method Summary

Modifier and TypeMethod and Description
public PVector<E>
minus(Object e)

Redeclares org.pcollections.PSequence.minus.

Returns a sequence consisting of the elements of this without the first occurrence of e.

public PVector<E>
public PVector<E>
public PVector<E>
plus(E e)

Redeclares org.pcollections.PSequence.plus.

Returns a vector consisting of the elements of this with e appended.

public PVector<E>
plus(int i, E e)

Redeclares org.pcollections.PSequence.plus.

public PVector<E>
plusAll(Collection<? extends E> list)

Redeclares org.pcollections.PSequence.plusAll.

Returns a vector consisting of the elements of this with list appended.

public PVector<E>
plusAll(int i, Collection<? extends E> list)

Redeclares org.pcollections.PSequence.plusAll.

public PVector<E>
subList(int
low endpoint (inclusive) of the subList
start
,
int
high endpoint (exclusive) of the subList
end
)

Redeclares org.pcollections.PSequence.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

public PVector<E>
with(int i, E e)

Redeclares org.pcollections.PSequence.with.

Inherited from org.pcollections.PSequence:
addaddAllremoveset

Method Detail

minusback to summary
public PVector<E> minus(Object e)

Redeclares org.pcollections.PSequence.minus.

Doc from org.pcollections.PSequence.minus.

Returns a sequence consisting of the elements of this without the first occurrence of e.

Returns:PVector<E>

Doc from org.pcollections.PCollection.minus.

this with a single instance of e removed, if e is in this

minusback to summary
public PVector<E> minus(int i)

Redeclares org.pcollections.PSequence.minus.

Returns:PVector<E>

Doc from org.pcollections.PSequence.minus.

a sequence consisting of the elements of this with the element at index i removed.

minusAllback to summary
public PVector<E> minusAll(Collection<?> list)

Redeclares org.pcollections.PSequence.minusAll.

Returns:PVector<E>

Doc from org.pcollections.PCollection.minusAll.

this with all elements of list completely removed

plusback to summary
public PVector<E> plus(E e)

Redeclares org.pcollections.PSequence.plus.

Returns a vector consisting of the elements of this with e appended.

Returns:PVector<E>

Doc from org.pcollections.PCollection.plus.

a collection which contains e and all of the elements of this

plusback to summary
public PVector<E> plus(int i, E e)

Redeclares org.pcollections.PSequence.plus.

Returns:PVector<E>

Doc from org.pcollections.PSequence.plus.

a sequence consisting of the elements of this with e inserted at index i.

plusAllback to summary
public PVector<E> plusAll(Collection<? extends E> list)

Redeclares org.pcollections.PSequence.plusAll.

Returns a vector consisting of the elements of this with list appended.

Returns:PVector<E>

Doc from org.pcollections.PCollection.plusAll.

a collection which contains all of the elements of list and this

plusAllback to summary
public PVector<E> plusAll(int i, Collection<? extends E> list)

Redeclares org.pcollections.PSequence.plusAll.

Returns:PVector<E>

Doc from org.pcollections.PSequence.plusAll.

a sequence consisting of the elements of this with list inserted at index i.

subListback to summary
public PVector<E> subList(int start, int end)

Redeclares org.pcollections.PSequence.subList.

Doc from java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. (If fromIndex and toIndex are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.

This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:

list.subList(from, to).clear();
Similar idioms may be constructed for indexOf and lastIndexOf, and all of the algorithms in the Collections class can be applied to a subList.

The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)

Parameters
start:int

low endpoint (inclusive) of the subList

end:int

high endpoint (exclusive) of the subList

Returns:PVector<E>

a view of the specified range within this list

withback to summary
public PVector<E> with(int i, E e)

Redeclares org.pcollections.PSequence.with.

Returns:PVector<E>

Doc from org.pcollections.PSequence.with.

a sequence consisting of the elements of this with e replacing the element at index i.