T - The type of the values in the sequence.public interface Seq<T> extends Streamable<T>
| Modifier and Type | Method and Description |
|---|---|
default Seq<T> |
append(Seq<T> items)
Append a second sequence to this sequence.
|
Seq<T> |
cons(T item)
Add an item to the start of the sequence.
|
static <T> Seq<T> |
empty()
Creates an empty sequence.
|
default java.util.stream.Stream<T> |
get()
Gets a stream of the items in the sequence.
|
T |
head()
Get the first item in the sequence.
|
boolean |
isEmpty()
Test if the sequence is empty.
|
static <T> Seq<T> |
of(Collection<T> collection)
Creates a sequence from a collection
|
static <T> Seq<T> |
of(List<T> list)
Creates a sequence from an ordered list
|
static <T> Seq<T> |
of(java.util.stream.Stream<T> stream)
Creates a sequence from a stream by consing each item onto an initially empty stream.
|
static <T> Seq<T> |
of(T... items)
Creates a sequence containing zero or more items.
|
default Seq<T> |
reverse()
Returns the stream in reverse order.
|
static <T> Seq<T> |
singleton(T item)
Creates a sequence containing only one item.
|
Seq<T> |
tail()
Get the remaining items in the sequence.
|
default Seq<T> |
toSeq()
Stream this streamable, and collect the stream into a Seq.
|
static <T> Seq<T> empty()
empty in interface Streamable<T>T - The type of the values in the sequence.static <T> Seq<T> singleton(T item)
T - The type of the values in the sequence.item - The item in the sequence.@SafeVarargs static <T> Seq<T> of(T... items)
of in interface Streamable<T>T - The type of the items.items - The items in the sequence.static <T> Seq<T> of(List<T> list)
T - The type of the items.list - The list of items to put in the sequence.static <T> Seq<T> of(Collection<T> collection)
of in interface Streamable<T>T - The type of the items.collection - The collection of items to put in the sequence.static <T> Seq<T> of(java.util.stream.Stream<T> stream)
T - The type of the items.stream - The stream of values to put in the sequence.T head()
Seq<T> tail()
Seq<T> cons(T item)
item - The item to add to the sequence.default Seq<T> append(Seq<T> items)
items - The sequence to append to this sequence.boolean isEmpty()
default java.util.stream.Stream<T> get()
get in interface java.util.function.Supplier<java.util.stream.Stream<T>>default Seq<T> toSeq()
StreamabletoSeq in interface Streamable<T>Copyright © 2020. All rights reserved.