public final class Seq<A>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Seq<A> |
append(Seq<A> as)
Appends the given sequence to this sequence.
|
Seq<A> |
cons(A a)
Inserts the given element at the front of this sequence.
|
static <A> Seq<A> |
empty()
The empty sequence.
|
A |
index(int i)
Returns the element at the given index.
|
boolean |
isEmpty()
Checks if this is the empty sequence.
|
int |
length()
Returns the number of elements in this sequence.
|
static <A> Seq<A> |
single(A a)
A singleton sequence.
|
Seq<A> |
snoc(A a)
Inserts the given element at the end of this sequence.
|
public static <A> Seq<A> empty()
public static <A> Seq<A> single(A a)
a
- The single element in the sequence.public Seq<A> cons(A a)
a
- An element to insert at the front of this sequence.public Seq<A> snoc(A a)
a
- An element to insert at the end of this sequence.public Seq<A> append(Seq<A> as)
as
- A sequence to append to this one.public boolean isEmpty()
public int length()
public A index(int i)
i
- The index of the element to return.