This implementation is thread-safe (assuming Java's AbstractSequentialList is thread-safe), although its iterators may not be.
| Modifier and Type | Field and Description |
|---|---|
| private static final ConsPStack | |
| private final E | |
| private final ConsPStack | |
| private static final long | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <E> ConsPStack | |
| public static <E> ConsPStack | Returns: a stack consisting of the elements of list in the order of list.iterator()
|
| private static <E> ConsPStack | |
| public ListIterator | listIterator(final int
index of the first element to be returned from the
list iterator (by a call to index)next)Implements abstract java. Implements java. Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. |
| public ConsPStack | minus(final Object e)
Implements org. Returns a sequence consisting of the elements of this without the first occurrence of e. |
| public ConsPStack | |
| public ConsPStack | |
| public ConsPStack | plus(final E e)
Implements org. Returns a stack consisting of the elements of this with e prepended. |
| public ConsPStack | |
| public ConsPStack | plusAll(final Collection<? extends E> list)
Implements org. Returns a stack consisting of the elements of this with list prepended in reverse. |
| public ConsPStack | |
| public static <E> ConsPStack | |
| public int | size()
Implements abstract java. Implements java. Returns the number of elements in this list. |
| public ConsPStack | subList(final int
low endpoint (inclusive) of the subList start, final int high endpoint (exclusive) of the subList end)Overrides java. Implements org. Returns a view of the portion of this list between the specified
|
| public ConsPStack | |
| public ConsPStack |
| EMPTY | back to summary |
|---|---|
| private static final ConsPStack<Object> EMPTY | |
| first | back to summary |
|---|---|
| private final E first | |
| rest | back to summary |
|---|---|
| private final ConsPStack<E> rest | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| size | back to summary |
|---|---|
| private final int size | |
| ConsPStack | back to summary |
|---|---|
| private ConsPStack() | |
| ConsPStack | back to summary |
|---|---|
| private ConsPStack(final E first, final ConsPStack<E> rest) | |
| empty | back to summary |
|---|---|
public static <E> ConsPStack
| |
| from | back to summary |
|---|---|
public static <E> ConsPStack
| |
| from | back to summary |
|---|---|
| private static <E> ConsPStack | |
| listIterator | back to summary |
|---|---|
| public ListIterator Implements abstract java. Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper
sequence), starting at the specified position in the list.
The specified index indicates the first element that would be
returned by an initial call to
| |
| minus | back to summary |
|---|---|
| public ConsPStack Implements org. Doc from org. Returns a sequence consisting of the elements of this without the first occurrence of e.
| |
| minus | back to summary |
|---|---|
| public ConsPStack Implements org.
| |
| minusAll | back to summary |
|---|---|
| public ConsPStack Implements org.
| |
| plus | back to summary |
|---|---|
| public ConsPStack Implements org. Doc from org. Returns a stack consisting of the elements of this with e prepended.
| |
| plus | back to summary |
|---|---|
| public ConsPStack Implements org.
| |
| plusAll | back to summary |
|---|---|
| public ConsPStack Implements org. Doc from org. Returns a stack consisting of the elements of this with list prepended in reverse.
| |
| plusAll | back to summary |
|---|---|
| public ConsPStack Implements org.
| |
| singleton | back to summary |
|---|---|
public static <E> ConsPStack
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |
| subList | back to summary |
|---|---|
| public ConsPStack Overrides java. Implements org. Doc from java. Returns a view of the portion of this list between the specified
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:
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.)
| |
| subList | back to summary |
|---|---|
| public ConsPStack Implements org.
| |
| with | back to summary |
|---|---|
| public ConsPStack Implements org.
| |