Modifier and Type | Class and Description |
---|---|
static interface |
Iter.Folder<X,Y> |
Modifier and Type | Method and Description |
---|---|
static <T> Iterator<T> |
append(Iterable<T> iter1,
Iterable<T> iter2) |
static <T> Iterator<T> |
append(Iterator<? extends T> iter1,
Iterator<? extends T> iter2) |
Iter<T> |
append(Iterator<T> iter) |
void |
apply(Action<T> action) |
static <T> void |
apply(Iterable<? extends T> stream,
Action<T> action) |
static <T> void |
apply(Iterator<? extends T> stream,
Action<T> action) |
static <K,V> void |
apply(Map<K,V> map,
ActionKeyValue<K,V> action) |
String |
asString() |
static <T> String |
asString(Iter<T> stream) |
static <T> String |
asString(Iter<T> stream,
AccString<T> formatter) |
static <T> String |
asString(Iter<T> stream,
String sep) |
static <T> String |
asString(Iterable<T> stream) |
static <T> String |
asString(Iterable<T> stream,
AccString<T> formatter) |
static <T> String |
asString(Iterable<T> stream,
String sep) |
static <T> String |
asString(Iterator<T> stream) |
static <T> String |
asString(Iterator<T> stream,
AccString<T> formatter) |
static <T> String |
asString(Iterator<T> stream,
String sep) |
String |
asString(String sep) |
static <T> void |
close(Iterator<T> iter) |
static <T> Iter<T> |
concat(Iter<T> iter1,
Iter<T> iter2) |
static <T> Iterator<T> |
concat(Iterator<T> iter1,
Iterator<T> iter2) |
static <T> void |
consume(Iterable<T> iterator)
Consume the iterable
|
static <T> void |
consume(Iterator<T> iterator)
Consume the iterator
|
static <T> Iterator<T> |
convert(Iterator<?> iterator) |
long |
count()
Count the iterator (this is destructive on the iterator)
|
static <T> long |
count(Iterable<T> iterable)
Count the iterable - many iterable objects have a .size() operation which should be used in preference to this explicit counting operation
|
static <T> long |
count(Iterator<T> iterator)
Count the iterator (this is destructive on the iterator)
|
static <T> Iterator<T> |
debug(Iterator<T> stream)
Print an iterator to stdout, return a copy of the iterator.
|
static <T> Iterator<T> |
debug(PrintStream out,
Iterator<T> stream)
Print an iterator to stdout, return a copy of the iterator.
|
Iter<T> |
distinct() |
static <T> Iterator<T> |
distinct(Iterable<T> iter) |
static <T> Iterator<T> |
distinct(Iterator<T> iter) |
Iter<T> |
distinctAdjacent() |
static <T> Iterator<T> |
distinctAdjacent(Iterable<T> iter)
Remove adjacent duplicates
|
static <T> Iterator<T> |
distinctAdjacent(Iterator<T> iter)
Remove adjacent duplicates
|
boolean |
every(Filter<T> filter) |
static <T> boolean |
every(Iterable<? extends T> stream,
Filter<T> filter)
Return true if every element of stream passes the filter (reads the stream)
|
static <T> boolean |
every(Iterator<? extends T> stream,
Filter<T> filter)
Return true if every element of stream passes the filter (reads the stream until the first element not passing the filter)
|
Iter<T> |
filter(Filter<T> filter) |
static <T> Iterator<T> |
filter(Iterable<? extends T> stream,
Filter<T> filter) |
static <T> Iterator<T> |
filter(Iterator<? extends T> stream,
Filter<T> filter) |
static <T> T |
first(Collection<T> collection,
Filter<T> filter) |
T |
first(Filter<T> filter) |
static <T> T |
first(Iterator<T> iter,
Filter<T> filter) |
static <T> int |
firstIndex(Collection<T> collection,
Filter<T> filter) |
int |
firstIndex(Filter<T> filter) |
static <T> int |
firstIndex(Iterator<T> iter,
Filter<T> filter) |
static <T,R> R |
foldLeft(Iterable<? extends T> stream,
Iter.Folder<T,R> function,
R value) |
static <T,R> R |
foldLeft(Iterator<? extends T> stream,
Iter.Folder<T,R> function,
R value) |
static <T,R> R |
foldRight(Iterable<? extends T> stream,
Iter.Folder<T,R> function,
R value) |
static <T,R> R |
foldRight(Iterator<? extends T> stream,
Iter.Folder<T,R> function,
R value) |
boolean |
hasNext() |
static <T> Iter<T> |
iter(Collection<T> collection) |
static <T> Iter<T> |
iter(Iter<T> iter) |
static <T> Iter<T> |
iter(Iterable<T> iterable) |
static <T> Iter<T> |
iter(Iterator<T> iterator) |
Iterator<T> |
iterator() |
static <T> Iterator<T> |
iterator(Iterator<? extends T> iterator)
Create another iterator without risk of concurrent modification exceptions.
|
static <T> Iter<T> |
iterSingleton(T x) |
static <T> T |
last(Collection<T> collection,
Filter<T> filter) |
T |
last(Filter<T> filter) |
static <T> T |
last(Iterator<T> iter,
Filter<T> filter) |
static <T> int |
lastIndex(Collection<T> collection,
Filter<T> filter) |
int |
lastIndex(Filter<T> filter) |
static <T> int |
lastIndex(Iterator<T> iter,
Filter<T> filter) |
static <T,R> Iterator<R> |
map(Iterable<? extends T> stream,
Transform<T,R> converter) |
static <T,R> Iterator<R> |
map(Iterator<? extends T> stream,
Transform<T,R> converter) |
static <T,R> List<R> |
map(List<? extends T> list,
Transform<T,R> converter) |
<R> Iter<R> |
map(Transform<T,R> converter) |
static <T,R> Iterator<R> |
mapMany(Iterable<? extends T> stream,
Transform<T,Iterator<R>> converter) |
static <T,R> Iterator<R> |
mapMany(Iterator<? extends T> stream,
Transform<? super T,Iterator<R>> converter)
Projects each element of a sequence to an Iterator<R> and flattens the resulting sequences into one sequence.
|
static <T,R> List<R> |
mapMany(List<? extends T> list,
Transform<T,Iterator<R>> converter) |
static <T> Iterator<T> |
materialize(Iterator<T> iter)
Materialize an iterator, that is, force it to run now - useful in debugging
|
T |
next() |
static <T> Iterator<T> |
notFilter(Iterable<? extends T> stream,
Filter<T> filter) |
static <T> Iterator<T> |
notFilter(Iterator<? extends T> stream,
Filter<T> filter) |
static <T> Iter<T> |
nullIter() |
static <T> Iterator<T> |
nullIterator() |
Iter<T> |
operate(Action<T> action)
Apply an action to everything in the stream, yielding a stream of the same items
|
static <T> Iterator<T> |
operate(Iterable<? extends T> stream,
Action<T> converter)
Apply an action to everything in stream, yielding a stream of the same items
|
static <T> Iterator<T> |
operate(Iterator<? extends T> stream,
Action<T> action)
Apply an action to everything in stream, yielding a stream of the same items
|
static <T> void |
print(Iterator<T> stream)
Print an iterator (destructive)
|
static <T> void |
print(PrintStream out,
Iterator<T> stream)
Print an iterator (destructive)
|
static <T> Iterator<T> |
printWrapper(Iterator<? extends T> stream)
Print an iterator as it gets used - this adds a printing wrapper
|
static <T> Iterator<T> |
printWrapper(PrintStream out,
Iterator<? extends T> stream)
Print an iterator as it gets used - this adds a printing wrapper
|
<R> R |
reduce(Accumulate<T,R> aggregator) |
static <T,R> R |
reduce(Iterable<? extends T> stream,
Accumulate<T,R> aggregator) |
static <T,R> R |
reduce(Iterator<? extends T> stream,
Accumulate<T,R> aggregator) |
void |
remove() |
Iter<T> |
removeNulls() |
static <T> Iterator<T> |
removeNulls(Iterable<T> iter) |
static <T> Iterator<T> |
removeNulls(Iterator<T> iter) |
static <T> void |
sendToSink(Iterable<T> stream,
Sink<T> sink)
Send the elements of the iterator to a sink - consumes the iterator
|
static <T> void |
sendToSink(Iterator<T> iter,
Sink<T> sink)
Send the elements of the iterator to a sink - consumes the iterator
|
void |
sendToSink(Sink<T> sink) |
static <T> Iterator<T> |
singleton(T item) |
static <T> Iter<T> |
singletonIter(T item) |
boolean |
some(Filter<T> filter) |
static <T> boolean |
some(Iterable<? extends T> stream,
Filter<T> filter)
Return true if every element of stream passes the filter (reads the stream until the first element passing the filter)
|
static <T> boolean |
some(Iterator<? extends T> stream,
Filter<T> filter)
Return true if one or more elements of stream passes the filter (reads the stream to first element passing the filter)
|
Iter<T> |
take(int N)
Return an Iter that yields at most the first N items
|
static <T> List<T> |
take(Iterator<T> iter,
int N)
Take the first N elements of an iterator - stop early if too few
|
List<T> |
toList() |
static <T> List<T> |
toList(Iterable<? extends T> stream) |
static <T> List<T> |
toList(Iterator<? extends T> stream) |
Set<T> |
toSet() |
static <T> Set<T> |
toSet(Iterable<? extends T> stream) |
static <T> Set<T> |
toSet(Iterator<? extends T> stream) |
public static <T> Iterator<T> singleton(T item)
public static <T> Iterator<T> nullIterator()
public static <T> Iterator<T> iterator(Iterator<? extends T> iterator)
public static <T,R> R foldLeft(Iterable<? extends T> stream, Iter.Folder<T,R> function, R value)
public static <T,R> R foldLeft(Iterator<? extends T> stream, Iter.Folder<T,R> function, R value)
public static <T,R> R foldRight(Iterable<? extends T> stream, Iter.Folder<T,R> function, R value)
public static <T,R> R foldRight(Iterator<? extends T> stream, Iter.Folder<T,R> function, R value)
public static <T,R> R reduce(Iterable<? extends T> stream, Accumulate<T,R> aggregator)
public static <T,R> R reduce(Iterator<? extends T> stream, Accumulate<T,R> aggregator)
public static <K,V> void apply(Map<K,V> map, ActionKeyValue<K,V> action)
public static <T> boolean every(Iterable<? extends T> stream, Filter<T> filter)
public static <T> boolean every(Iterator<? extends T> stream, Filter<T> filter)
public static <T> boolean some(Iterable<? extends T> stream, Filter<T> filter)
public static <T> boolean some(Iterator<? extends T> stream, Filter<T> filter)
public static <T,R> Iterator<R> mapMany(Iterator<? extends T> stream, Transform<? super T,Iterator<R>> converter)
public static <T,R> Iterator<R> mapMany(Iterable<? extends T> stream, Transform<T,Iterator<R>> converter)
public static <T,R> List<R> mapMany(List<? extends T> list, Transform<T,Iterator<R>> converter)
public static <T> Iterator<T> operate(Iterable<? extends T> stream, Action<T> converter)
public static <T> Iterator<T> operate(Iterator<? extends T> stream, Action<T> action)
public static <T> Iterator<T> printWrapper(Iterator<? extends T> stream)
public static <T> Iterator<T> printWrapper(PrintStream out, Iterator<? extends T> stream)
public static <T> Iterator<T> append(Iterator<? extends T> iter1, Iterator<? extends T> iter2)
public static <T> Iterator<T> distinctAdjacent(Iterable<T> iter)
public static <T> Iterator<T> distinctAdjacent(Iterator<T> iter)
public static <T> List<T> take(Iterator<T> iter, int N)
public static <T> long count(Iterable<T> iterable)
public static <T> long count(Iterator<T> iterator)
public static <T> void consume(Iterable<T> iterator)
public static <T> void consume(Iterator<T> iterator)
public static <T> void close(Iterator<T> iter)
public static <T> Iterator<T> debug(Iterator<T> stream)
public static <T> Iterator<T> debug(PrintStream out, Iterator<T> stream)
public static <T> void print(Iterator<T> stream)
public static <T> void print(PrintStream out, Iterator<T> stream)
public static <T> void sendToSink(Iterator<T> iter, Sink<T> sink)
public static <T> void sendToSink(Iterable<T> stream, Sink<T> sink)
public static <T> Iter<T> iterSingleton(T x)
public static <T> Iter<T> iter(Collection<T> collection)
public static <T> Iter<T> singletonIter(T item)
public static <T> Iter<T> nullIter()
public static <T> Iterator<T> materialize(Iterator<T> iter)
public static <T> T first(Collection<T> collection, Filter<T> filter)
public static <T> int firstIndex(Collection<T> collection, Filter<T> filter)
public static <T> T last(Collection<T> collection, Filter<T> filter)
public static <T> int lastIndex(Collection<T> collection, Filter<T> filter)
public Iter<T> operate(Action<T> action)
public <R> R reduce(Accumulate<T,R> aggregator)
public long count()
public String asString()
Licenced under the Apache License, Version 2.0