Package | Description |
---|---|
javaslang | |
javaslang.collection |
Purely functional collections based on Traversable.
|
javaslang.control |
Modifier and Type | Method and Description |
---|---|
static <T,_1 extends T,_2 extends List<T>> |
Patterns.List(API.Match.Pattern<_1,?> p1,
API.Match.Pattern<_2,?> p2) |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
API.List()
Alias for
empty() |
static <T> List<T> |
API.List(T... elements)
Alias for
of(Object...) |
static <T> List<T> |
API.List(T element)
Alias for
of(Object) |
default List<T> |
Value.toList()
Converts this to a
List . |
Modifier and Type | Class and Description |
---|---|
static class |
List.Cons<T>
Non-empty
List , consisting of a head and a tail . |
static class |
List.Nil<T>
Representation of the singleton empty
List . |
Modifier and Type | Method and Description |
---|---|
default List<T> |
List.append(T element) |
default List<T> |
List.appendAll(Iterable<? extends T> elements) |
default List<List<T>> |
List.combinations() |
default List<List<T>> |
List.combinations(int k) |
default List<T> |
List.distinct() |
default List<T> |
List.distinctBy(Comparator<? super T> comparator) |
default <U> List<T> |
List.distinctBy(Function<? super T,? extends U> keyExtractor) |
default List<T> |
List.drop(int n) |
default List<T> |
List.dropRight(int n) |
default List<T> |
List.dropUntil(Predicate<? super T> predicate) |
default List<T> |
List.dropWhile(Predicate<? super T> predicate) |
static <T> List<T> |
List.empty()
Returns the single instance of Nil.
|
static <T> List<T> |
List.fill(int n,
Supplier<? extends T> s)
Returns a List containing
n values supplied by a given Supplier s . |
default List<T> |
List.filter(Predicate<? super T> predicate) |
default <U> List<U> |
List.flatMap(Function<? super T,? extends Iterable<? extends U>> mapper) |
List<Tree.Node<T>> |
Tree.getChildren()
Returns the children of this tree.
|
List<Tree.Node<T>> |
Tree.Node.getChildren() |
List<Tree.Node<T>> |
Tree.Empty.getChildren() |
default List<T> |
List.init() |
default List<T> |
List.insert(int index,
T element) |
default List<T> |
List.insertAll(int index,
Iterable<? extends T> elements) |
default List<T> |
List.intersperse(T element) |
default List<T> |
List.leftPadTo(int length,
T element) |
default <U> List<U> |
List.map(Function<? super T,? extends U> mapper) |
static <T> List<T> |
List.narrow(List<? extends T> list)
Narrows a widened
List<? extends T> to List<T>
by performing a type-safe cast. |
static <T> List<T> |
List.of(T... elements)
Creates a List of the given elements.
|
static <T> List<T> |
List.of(T element)
Returns a singleton
List , i.e. |
static List<Boolean> |
List.ofAll(boolean[] array)
Creates a List based on the elements of a boolean array.
|
static List<Byte> |
List.ofAll(byte[] array)
Creates a List based on the elements of a byte array.
|
static List<Character> |
List.ofAll(char[] array)
Creates a List based on the elements of a char array.
|
static List<Double> |
List.ofAll(double[] array)
Creates a List based on the elements of a double array.
|
static List<Float> |
List.ofAll(float[] array)
Creates a List based on the elements of a float array.
|
static List<Integer> |
List.ofAll(int[] array)
Creates a List based on the elements of an int array.
|
static <T> List<T> |
List.ofAll(Iterable<? extends T> elements)
Creates a List of the given elements.
|
static List<Long> |
List.ofAll(long[] array)
Creates a List based on the elements of a long array.
|
static List<Short> |
List.ofAll(short[] array)
Creates a List based on the elements of a short array.
|
static <T> List<T> |
List.ofAll(Stream<? extends T> javaStream)
Creates a List that contains the elements of the given
Stream . |
default List<T> |
List.padTo(int length,
T element) |
default List<T> |
List.patch(int from,
Iterable<? extends T> that,
int replaced) |
default List<T> |
List.peek(Consumer<? super T> action)
Performs an action on the head element of this
List . |
default List<List<T>> |
List.permutations() |
default List<T> |
List.pop() |
default List<T> |
List.prepend(T element) |
default List<T> |
List.prependAll(Iterable<? extends T> elements) |
default List<T> |
List.push(T... elements) |
default List<T> |
List.push(T element) |
default List<T> |
List.pushAll(Iterable<T> elements) |
static List<Character> |
List.range(char from,
char toExclusive) |
static List<Integer> |
List.range(int from,
int toExclusive)
Creates a List of int numbers starting from
from , extending to toExclusive - 1 . |
static List<Long> |
List.range(long from,
long toExclusive)
Creates a List of long numbers starting from
from , extending to toExclusive - 1 . |
static List<Character> |
List.rangeBy(char from,
char toExclusive,
int step) |
static List<Double> |
List.rangeBy(double from,
double toExclusive,
double step) |
static List<Integer> |
List.rangeBy(int from,
int toExclusive,
int step)
Creates a List of int numbers starting from
from , extending to toExclusive - 1 ,
with step . |
static List<Long> |
List.rangeBy(long from,
long toExclusive,
long step)
Creates a List of long numbers starting from
from , extending to toExclusive - 1 ,
with step . |
static List<Character> |
List.rangeClosed(char from,
char toInclusive) |
static List<Integer> |
List.rangeClosed(int from,
int toInclusive)
Creates a List of int numbers starting from
from , extending to toInclusive . |
static List<Long> |
List.rangeClosed(long from,
long toInclusive)
Creates a List of long numbers starting from
from , extending to toInclusive . |
static List<Character> |
List.rangeClosedBy(char from,
char toInclusive,
int step) |
static List<Double> |
List.rangeClosedBy(double from,
double toInclusive,
double step) |
static List<Integer> |
List.rangeClosedBy(int from,
int toInclusive,
int step)
Creates a List of int numbers starting from
from , extending to toInclusive ,
with step . |
static List<Long> |
List.rangeClosedBy(long from,
long toInclusive,
long step)
Creates a List of long numbers starting from
from , extending to toInclusive ,
with step . |
default List<T> |
List.remove(T element) |
default List<T> |
List.removeAll(Iterable<? extends T> elements) |
default List<T> |
List.removeAll(Predicate<? super T> predicate) |
default List<T> |
List.removeAll(T element) |
default List<T> |
List.removeAt(int index) |
default List<T> |
List.removeFirst(Predicate<T> predicate) |
default List<T> |
List.removeLast(Predicate<T> predicate) |
default List<T> |
List.replace(T currentElement,
T newElement) |
default List<T> |
List.replaceAll(T currentElement,
T newElement) |
default List<T> |
List.retainAll(Iterable<? extends T> elements) |
default List<T> |
List.reverse() |
default List<T> |
List.scan(T zero,
BiFunction<? super T,? super T,? extends T> operation) |
default <U> List<U> |
List.scanLeft(U zero,
BiFunction<? super U,? super T,? extends U> operation) |
default <U> List<U> |
List.scanRight(U zero,
BiFunction<? super T,? super U,? extends U> operation) |
default List<T> |
List.shuffle() |
default List<T> |
List.slice(int beginIndex,
int endIndex) |
default <U> List<T> |
List.sortBy(Comparator<? super U> comparator,
Function<? super T,? extends U> mapper) |
default <U extends Comparable<? super U>> |
List.sortBy(Function<? super T,? extends U> mapper) |
default List<T> |
List.sorted() |
default List<T> |
List.sorted(Comparator<? super T> comparator) |
default List<T> |
List.subSequence(int beginIndex) |
default List<T> |
List.subSequence(int beginIndex,
int endIndex) |
static <T> List<T> |
List.tabulate(int n,
Function<? super Integer,? extends T> f)
Returns a List containing
n values of a given Function f
over a range of integer values from 0 to n - 1 . |
List<T> |
List.tail() |
List<T> |
List.Nil.tail() |
List<T> |
List.Cons.tail() |
default List<T> |
List.take(int n) |
default List<T> |
List.takeRight(int n) |
default List<T> |
List.takeUntil(Predicate<? super T> predicate) |
default List<T> |
List.takeWhile(Predicate<? super T> predicate) |
List<T> |
PriorityQueue.toList() |
static <T> List<T> |
List.unfold(T seed,
Function<? super T,Option<Tuple2<? extends T,? extends T>>> f)
Creates a list from a seed value and a function.
|
static <T,U> List<U> |
List.unfoldLeft(T seed,
Function<? super T,Option<Tuple2<? extends T,? extends U>>> f)
Creates a list from a seed value and a function.
|
static <T,U> List<U> |
List.unfoldRight(T seed,
Function<? super T,Option<Tuple2<? extends U,? extends T>>> f)
Creates a list from a seed value and a function.
|
default <U> List<U> |
List.unit(Iterable<? extends U> iterable) |
default List<T> |
List.update(int index,
T element) |
default <U> List<Tuple2<T,U>> |
List.zip(Iterable<? extends U> that) |
default <U> List<Tuple2<T,U>> |
List.zipAll(Iterable<? extends U> that,
T thisElem,
U thatElem) |
default <U,R> List<R> |
List.zipWith(Iterable<? extends U> that,
BiFunction<? super T,? super U,? extends R> mapper) |
default List<Tuple2<T,Integer>> |
List.zipWithIndex() |
default <U> List<U> |
List.zipWithIndex(BiFunction<? super T,? super Integer,? extends U> mapper) |
Modifier and Type | Method and Description |
---|---|
static <T> Collector<T,ArrayList<T>,List<T>> |
List.collector()
Returns a
Collector which may be used in conjunction with
Stream.collect(java.util.stream.Collector) to obtain a List . |
default List<List<T>> |
List.combinations() |
default List<List<T>> |
List.combinations(int k) |
default Iterator<List<T>> |
List.crossProduct(int power) |
default <C> Map<C,List<T>> |
List.groupBy(Function<? super T,? extends C> classifier) |
default Iterator<List<T>> |
List.grouped(int size) |
default Option<List<T>> |
List.initOption() |
default Tuple2<List<T>,List<T>> |
List.partition(Predicate<? super T> predicate) |
default Tuple2<List<T>,List<T>> |
List.partition(Predicate<? super T> predicate) |
default List<List<T>> |
List.permutations() |
default Tuple2<T,List<T>> |
List.pop2() |
default Option<Tuple2<T,List<T>>> |
List.pop2Option() |
default Option<List<T>> |
List.popOption() |
default Iterator<List<T>> |
List.sliding(int size) |
default Iterator<List<T>> |
List.sliding(int size,
int step) |
default Tuple2<List<T>,List<T>> |
List.span(Predicate<? super T> predicate) |
default Tuple2<List<T>,List<T>> |
List.span(Predicate<? super T> predicate) |
default Tuple2<List<T>,List<T>> |
List.splitAt(int n) |
default Tuple2<List<T>,List<T>> |
List.splitAt(int n) |
default Tuple2<List<T>,List<T>> |
List.splitAt(Predicate<? super T> predicate) |
default Tuple2<List<T>,List<T>> |
List.splitAt(Predicate<? super T> predicate) |
default Tuple2<List<T>,List<T>> |
List.splitAtInclusive(Predicate<? super T> predicate) |
default Tuple2<List<T>,List<T>> |
List.splitAtInclusive(Predicate<? super T> predicate) |
default Option<List<T>> |
List.tailOption() |
default <T1,T2> Tuple2<List<T1>,List<T2>> |
List.unzip(Function<? super T,Tuple2<? extends T1,? extends T2>> unzipper) |
default <T1,T2> Tuple2<List<T1>,List<T2>> |
List.unzip(Function<? super T,Tuple2<? extends T1,? extends T2>> unzipper) |
default <T1,T2,T3> Tuple3<List<T1>,List<T2>,List<T3>> |
List.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper) |
default <T1,T2,T3> Tuple3<List<T1>,List<T2>,List<T3>> |
List.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper) |
default <T1,T2,T3> Tuple3<List<T1>,List<T2>,List<T3>> |
List.unzip3(Function<? super T,Tuple3<? extends T1,? extends T2,? extends T3>> unzipper) |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
List.narrow(List<? extends T> list)
Narrows a widened
List<? extends T> to List<T>
by performing a type-safe cast. |
Modifier and Type | Method and Description |
---|---|
default <U> U |
List.transform(Function<? super List<T>,? extends U> f)
Transforms this
List . |
Constructor and Description |
---|
Node(T value,
List<Tree.Node<T>> children)
Constructs a rose tree branch.
|
Modifier and Type | Method and Description |
---|---|
<R> Validation<List<E>,R> |
Validation.Builder.ap(Function2<T1,T2,R> f) |
<R> Validation<List<E>,R> |
Validation.Builder3.ap(Function3<T1,T2,T3,R> f) |
<R> Validation<List<E>,R> |
Validation.Builder4.ap(Function4<T1,T2,T3,T4,R> f) |
<R> Validation<List<E>,R> |
Validation.Builder5.ap(Function5<T1,T2,T3,T4,T5,R> f) |
<R> Validation<List<E>,R> |
Validation.Builder6.ap(Function6<T1,T2,T3,T4,T5,T6,R> f) |
<R> Validation<List<E>,R> |
Validation.Builder7.ap(Function7<T1,T2,T3,T4,T5,T6,T7,R> f) |
<R> Validation<List<E>,R> |
Validation.Builder8.ap(Function8<T1,T2,T3,T4,T5,T6,T7,T8,R> f) |
default <U> Validation<List<E>,U> |
Validation.ap(Validation<List<E>,? extends Function<? super T,? extends U>> validation) |
static <E,T> Validation<List<E>,Seq<T>> |
Validation.sequence(Iterable<? extends Validation<List<E>,T>> values)
Reduces many
Validation instances into a single Validation by transforming an
Iterable<Validation<? extends T>> into a Validation<Seq<T>> . |
Modifier and Type | Method and Description |
---|---|
default <U> Validation<List<E>,U> |
Validation.ap(Validation<List<E>,? extends Function<? super T,? extends U>> validation) |
static <E,T> Validation<List<E>,Seq<T>> |
Validation.sequence(Iterable<? extends Validation<List<E>,T>> values)
Reduces many
Validation instances into a single Validation by transforming an
Iterable<Validation<? extends T>> into a Validation<Seq<T>> . |
Copyright © 2016. All Rights Reserved.