Modifier and Type | Method and Description |
---|---|
static <E> FList<E> |
cons(E head,
FList<E> tail)
Functional-programming cons.
|
static <E> FList<E> |
empty()
Returns an empty list.
|
abstract E |
getHead()
Returns the first element of the list.
|
abstract FList<E> |
getTail()
Returns the a sublist of this list without the first element.
|
abstract boolean |
isEmpty()
Checks if the list is empty.
|
static <E> FList<E> |
single(E item)
A list containing a single element.
|
static <E> FList<E> |
snoc(FList<E> head,
E tail)
Functional-programming snoc.
|
abstract List<E> |
toList()
Converts this functional list to an imperative list.
|
public abstract E getHead()
public abstract FList<E> getTail()
public abstract boolean isEmpty()
true
if and only if the list is empty, false
otherwisepublic abstract List<E> toList()
public static <E> FList<E> empty()
E
- the type of the elementspublic static <E> FList<E> single(E item)
E
- the type of the elementsitem
- the element of the listpublic static <E> FList<E> cons(E head, FList<E> tail)
E
- the type of the elementshead
- the beginning of the new listtail
- the end of the new listCopyright © 2013. All Rights Reserved.