Package com.github.underscore
Class Underscore.Chain<T>
- java.lang.Object
-
- com.github.underscore.Underscore.Chain<T>
-
- Direct Known Subclasses:
U.Chain
- Enclosing class:
- Underscore<T>
public static class Underscore.Chain<T> extends Object
-
-
Method Summary
-
-
-
Method Detail
-
first
public Underscore.Chain<T> first()
-
first
public Underscore.Chain<T> first(int n)
-
first
public Underscore.Chain<T> first(Predicate<T> pred)
-
first
public Underscore.Chain<T> first(Predicate<T> pred, int n)
-
firstOrNull
public Underscore.Chain<T> firstOrNull()
-
firstOrNull
public Underscore.Chain<T> firstOrNull(Predicate<T> pred)
-
initial
public Underscore.Chain<T> initial()
-
initial
public Underscore.Chain<T> initial(int n)
-
last
public Underscore.Chain<T> last()
-
last
public Underscore.Chain<T> last(int n)
-
lastOrNull
public Underscore.Chain<T> lastOrNull()
-
lastOrNull
public Underscore.Chain<T> lastOrNull(Predicate<T> pred)
-
rest
public Underscore.Chain<T> rest()
-
rest
public Underscore.Chain<T> rest(int n)
-
compact
public Underscore.Chain<T> compact()
-
compact
public Underscore.Chain<T> compact(T falsyValue)
-
flatten
public Underscore.Chain flatten()
-
map
public <F> Underscore.Chain<F> map(Function<? super T,F> func)
-
mapMulti
public <F> Underscore.Chain<F> mapMulti(BiConsumer<? super T,? super Consumer<F>> mapper)
-
mapIndexed
public <F> Underscore.Chain<F> mapIndexed(BiFunction<Integer,? super T,F> func)
-
replace
public Underscore.Chain<T> replace(Predicate<T> pred, T value)
-
replaceIndexed
public Underscore.Chain<T> replaceIndexed(Underscore.PredicateIndexed<T> pred, T value)
-
filter
public Underscore.Chain<T> filter(Predicate<T> pred)
-
filterIndexed
public Underscore.Chain<T> filterIndexed(Underscore.PredicateIndexed<T> pred)
-
reject
public Underscore.Chain<T> reject(Predicate<T> pred)
-
rejectIndexed
public Underscore.Chain<T> rejectIndexed(Underscore.PredicateIndexed<T> pred)
-
filterFalse
public Underscore.Chain<T> filterFalse(Predicate<T> pred)
-
reduce
public <F> Underscore.Chain<F> reduce(BiFunction<F,T,F> func, F zeroElem)
-
reduce
public Underscore.Chain<Optional<T>> reduce(BinaryOperator<T> func)
-
reduceRight
public <F> Underscore.Chain<F> reduceRight(BiFunction<F,T,F> func, F zeroElem)
-
reduceRight
public Underscore.Chain<Optional<T>> reduceRight(BinaryOperator<T> func)
-
find
public Underscore.Chain<Optional<T>> find(Predicate<T> pred)
-
findLast
public Underscore.Chain<Optional<T>> findLast(Predicate<T> pred)
-
max
public Underscore.Chain<Comparable> max()
-
max
public <F extends Comparable<? super F>> Underscore.Chain<T> max(Function<T,F> func)
-
min
public Underscore.Chain<Comparable> min()
-
min
public <F extends Comparable<? super F>> Underscore.Chain<T> min(Function<T,F> func)
-
sort
public Underscore.Chain<Comparable> sort()
-
sortWith
public <F extends Comparable<? super F>> Underscore.Chain<F> sortWith(Comparator<F> comparator)
-
sortBy
public <F extends Comparable<? super F>> Underscore.Chain<T> sortBy(Function<T,F> func)
-
sortBy
public <K> Underscore.Chain<Map<K,Comparable>> sortBy(K key)
-
associateBy
public <F> Underscore.Chain<Map<F,T>> associateBy(Function<T,F> func)
-
groupBy
public <F> Underscore.Chain<Map<F,Optional<T>>> groupBy(Function<T,F> func, BinaryOperator<T> binaryOperator)
-
countBy
public <F> Underscore.Chain<Map<F,Integer>> countBy(Function<T,F> func)
-
countBy
public Underscore.Chain<Map<T,Integer>> countBy()
-
shuffle
public Underscore.Chain<T> shuffle()
-
sample
public Underscore.Chain<T> sample()
-
sample
public Underscore.Chain<T> sample(int howMany)
-
tap
public Underscore.Chain<T> tap(Consumer<T> func)
-
forEach
public Underscore.Chain<T> forEach(Consumer<T> func)
-
forEachRight
public Underscore.Chain<T> forEachRight(Consumer<T> func)
-
every
public Underscore.Chain<Boolean> every(Predicate<T> pred)
-
some
public Underscore.Chain<Boolean> some(Predicate<T> pred)
-
count
public Underscore.Chain<Integer> count(Predicate<T> pred)
-
contains
public Underscore.Chain<Boolean> contains(T elem)
-
containsWith
public Underscore.Chain<Boolean> containsWith(T elem)
-
invoke
public Underscore.Chain<T> invoke(String methodName, List<Object> args)
-
invoke
public Underscore.Chain<T> invoke(String methodName)
-
pluck
public Underscore.Chain<Object> pluck(String propertyName)
-
where
public <E> Underscore.Chain<T> where(List<Map.Entry<String,E>> properties)
-
findWhere
public <E> Underscore.Chain<Optional<T>> findWhere(List<Map.Entry<String,E>> properties)
-
uniq
public Underscore.Chain<T> uniq()
-
uniq
public <F> Underscore.Chain<T> uniq(Function<T,F> func)
-
distinct
public Underscore.Chain<T> distinct()
-
distinctBy
public <F> Underscore.Chain<F> distinctBy(Function<T,F> func)
-
union
public Underscore.Chain<T> union(List<T>... lists)
-
intersection
public Underscore.Chain<T> intersection(List<T>... lists)
-
difference
public Underscore.Chain<T> difference(List<T>... lists)
-
range
public Underscore.Chain<Integer> range(int stop)
-
range
public Underscore.Chain<Integer> range(int start, int stop)
-
range
public Underscore.Chain<Integer> range(int start, int stop, int step)
-
chunk
public Underscore.Chain<List<T>> chunk(int size)
-
chunk
public Underscore.Chain<List<T>> chunk(int size, int step)
-
chunkFill
public Underscore.Chain<List<T>> chunkFill(int size, T fillValue)
-
chunkFill
public Underscore.Chain<List<T>> chunkFill(int size, int step, T fillValue)
-
cycle
public Underscore.Chain<T> cycle(int times)
-
interpose
public Underscore.Chain<T> interpose(T element)
-
interposeByList
public Underscore.Chain<T> interposeByList(Iterable<T> interIter)
-
concat
public Underscore.Chain<T> concat(List<T>... lists)
-
slice
public Underscore.Chain<T> slice(int start)
-
slice
public Underscore.Chain<T> slice(int start, int end)
-
splitAt
public Underscore.Chain<List<T>> splitAt(int position)
-
takeSkipping
public Underscore.Chain<T> takeSkipping(int stepSize)
-
reverse
public Underscore.Chain<T> reverse()
-
join
public Underscore.Chain<String> join()
-
join
public Underscore.Chain<String> join(String separator)
-
push
public Underscore.Chain<T> push(T... values)
-
pop
public Underscore.Chain<Map.Entry<T,List<T>>> pop()
-
shift
public Underscore.Chain<Map.Entry<T,List<T>>> shift()
-
unshift
public Underscore.Chain<T> unshift(T... values)
-
skip
public Underscore.Chain<T> skip(int numberToSkip)
-
limit
public Underscore.Chain<T> limit(int size)
-
toMap
public <K,V> Underscore.Chain<Map<K,V>> toMap()
-
isEmpty
public boolean isEmpty()
-
isNotEmpty
public boolean isNotEmpty()
-
size
public int size()
-
item
public T item()
-
-