|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.andrewoma.dexx.collection.internal.base.AbstractTraversable<E>
com.github.andrewoma.dexx.collection.internal.base.AbstractIterable<E>
com.github.andrewoma.dexx.collection.internal.base.AbstractList<E>
com.github.andrewoma.dexx.collection.internal.base.AbstractLinkedList<E>
com.github.andrewoma.dexx.collection.ConsList<E>
public abstract class ConsList<E>
ConsList is a functional LinkedList implementation
that constructs a list by prepending an element to another list.
WARNING: Appending to a ConsList results in copying the entire list - always
use a Builder when appending. Likewise,
operations like set(int, Object) will result in copying portions of the list.
If there is any doubt as to the access patterns for using a List, use a Vector
instead.
| Constructor Summary | |
|---|---|
ConsList()
|
|
| Method Summary | ||
|---|---|---|
abstract ConsList<E> |
append(E elem)
Returns a list with the specified element appended to the bottom of the list. |
|
abstract ConsList<E> |
drop(int number)
Returns a list containing all elements in this list, excluding the first number of elements. |
|
static
|
empty()
|
|
static
|
factory()
|
|
Iterator<E> |
iterator()
|
|
ConsList<E> |
prepend(E elem)
Returns a list with the specified element prepended to the top of the list. |
|
abstract ConsList<E> |
range(int from,
boolean fromInclusive,
int to,
boolean toInclusive)
Returns a list containing a contiguous range of elements from this list. |
|
abstract ConsList<E> |
set(int i,
E elem)
Returns a list with the element set to the value specified at the index (zero-based). |
|
abstract ConsList<E> |
tail()
Returns a list containing all elements in the list, excluding the first element. |
|
abstract ConsList<E> |
take(int number)
Returns a list containing the first number of elements from this list. |
|
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractList |
|---|
asList, equals, hashCode, indexOf, lastIndexOf |
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractIterable |
|---|
forEach |
| Methods inherited from class com.github.andrewoma.dexx.collection.internal.base.AbstractTraversable |
|---|
isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.github.andrewoma.dexx.collection.List |
|---|
asList, first, get, indexOf, last, lastIndexOf |
| Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable |
|---|
forEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet |
| Constructor Detail |
|---|
public ConsList()
| Method Detail |
|---|
@NotNull public static <E> BuilderFactory<E,ConsList<E>> factory()
public static <E> ConsList<E> empty()
@NotNull public ConsList<E> prepend(E elem)
List
@NotNull public abstract ConsList<E> append(E elem)
List
@NotNull public Iterator<E> iterator()
@NotNull
public abstract ConsList<E> range(int from,
boolean fromInclusive,
int to,
boolean toInclusive)
List
from - starting index for the range (zero-based)fromInclusive - if true, the element at the from index will be includedto - end index for the range (zero-based)toInclusive - if true, the element at the to index will be included@NotNull public abstract ConsList<E> tail()
List
@NotNull public abstract ConsList<E> take(int number)
Listnumber of elements from this list.
@NotNull public abstract ConsList<E> drop(int number)
Listnumber of elements.
@NotNull
public abstract ConsList<E> set(int i,
E elem)
List
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||