public final class Iterables extends Object
IteratorUtil
into one classConstructor and Description |
---|
Iterables() |
Modifier and Type | Method and Description |
---|---|
static <T,C extends Collection<T>> |
addAll(C collection,
Iterable<? extends T> iterable) |
static <T,C extends T> |
append(C item,
Iterable<T> iterable) |
static <T> ResourceIterable<T> |
asResourceIterable(Iterable<T> labels) |
static <T> ResourceIterable<T> |
asResourceIterable(ResourceIterator<T> it) |
static <T> Iterable<T> |
cache(Iterable<T> iterable) |
static <FROM,TO> org.neo4j.function.Function<FROM,TO> |
cast() |
static <T,C> Iterable<T> |
cast(Iterable<C> iterable) |
static <T> Iterable<T> |
concat(Iterable<? extends T>... iterables) |
static <T> Iterable<T> |
concat(Iterable<Iterable<T>> iterables) |
static <T> Iterator<T> |
concat(Iterator<? extends T>... iterables) |
static <T> Iterator<T> |
concat(Iterator<Iterator<T>> iterators) |
static <T> ResourceIterator<T> |
concatResourceIterators(Iterator<ResourceIterator<T>> iterators) |
static long |
count(Iterable<?> iterable) |
static <T> Iterable<T> |
empty() |
static <X> Iterable<X> |
filter(Predicate<? super X> specification,
Iterable<X> i)
Deprecated.
use
filter(Predicate, Iterable) instead |
static <X> Iterable<X> |
filter(org.neo4j.function.Predicate<? super X> specification,
Iterable<X> i) |
static <X> Iterator<X> |
filter(Predicate<? super X> specification,
Iterator<X> i)
Deprecated.
use
filter(Predicate, Iterator) instead |
static <X> Iterator<X> |
filter(org.neo4j.function.Predicate<? super X> specification,
Iterator<X> i) |
static <X> X |
first(Iterable<? extends X> i) |
static <FROM,TO> Iterator<TO> |
flatMap(org.neo4j.function.Function<? super FROM,? extends Iterator<TO>> function,
Iterator<FROM> from) |
static <X,I extends Iterable<? extends X>> |
flatten(I... multiIterator) |
static <X,S extends Iterable<? extends X>,I extends Iterable<S>> |
flattenIterable(I multiIterator) |
static <T> int |
indexOf(T itemToFind,
Iterable<T> iterable)
Returns the index of the first occurrence of the specified element
in this iterable, or -1 if this iterable does not contain the element.
|
static <T,C extends T> |
iterable(C... items) |
static <T> ResourceIterable<T> |
iterable(org.neo4j.kernel.impl.transaction.log.IOCursor<T> cursor) |
static <T,C extends org.neo4j.cursor.Cursor> |
iterator(C resourceCursor,
org.neo4j.function.Function<C,T> map) |
static String |
join(String joinString,
Iterable<?> iter) |
static String |
join(String joinString,
Iterator<?> iter) |
static <X> X |
last(Iterable<? extends X> i) |
static <T> org.neo4j.function.Function<Iterable<T>,Iterable<T>> |
limit(int limitItems) |
static <T> Iterable<T> |
limit(int limitItems,
Iterable<T> iterable) |
static <FROM,TO> Iterable<TO> |
map(org.neo4j.function.Function<? super FROM,? extends TO> function,
Iterable<FROM> from) |
static <FROM,TO> Iterator<TO> |
map(org.neo4j.function.Function<? super FROM,? extends TO> function,
Iterator<FROM> from) |
static <T> Iterable<T> |
mix(Iterable<T>... iterables) |
static <T> Iterable<T> |
option(T item) |
static <T,C extends T> |
prepend(C item,
Iterable<T> iterable) |
static <X> Iterable<X> |
reverse(Iterable<X> iterable) |
static <X> X |
single(Iterable<? extends X> i) |
static <X> Iterable<X> |
skip(int skip,
Iterable<X> iterable) |
static <T,S extends Comparable> |
sort(Iterable<T> iterable,
org.neo4j.function.Function<T,S> compareFunction) |
static <T> T[] |
toArray(Class<T> componentType,
Iterable<T> iterable) |
static Object[] |
toArray(Iterable<Object> iterable) |
static <T> List<T> |
toList(Iterable<T> iterable) |
static <T> List<T> |
toList(Iterator<T> iterator) |
static <T> Set<T> |
toSet(Iterable<T> iterable) |
static String |
toString(Iterable<?> values,
String separator) |
static <T> Iterable<T> |
unique(Iterable<T> iterable) |
public static <T> Iterable<T> empty()
public static <T,C extends Collection<T>> C addAll(C collection, Iterable<? extends T> iterable)
public static long count(Iterable<?> iterable)
@Deprecated public static <X> Iterable<X> filter(Predicate<? super X> specification, Iterable<X> i)
filter(Predicate, Iterable)
insteadX
- the type of the elementsspecification
- filteri
- source iterablepublic static <X> Iterable<X> filter(org.neo4j.function.Predicate<? super X> specification, Iterable<X> i)
@Deprecated public static <X> Iterator<X> filter(Predicate<? super X> specification, Iterator<X> i)
filter(Predicate, Iterator)
insteadX
- the type of the elementsspecification
- filteri
- source iteratorpublic static <X> Iterator<X> filter(org.neo4j.function.Predicate<? super X> specification, Iterator<X> i)
public static <X> X first(Iterable<? extends X> i)
public static <X> X single(Iterable<? extends X> i)
public static <X> X last(Iterable<? extends X> i)
@SafeVarargs public static <X,I extends Iterable<? extends X>> Iterable<X> flatten(I... multiIterator)
public static <X,S extends Iterable<? extends X>,I extends Iterable<S>> Iterable<X> flattenIterable(I multiIterator)
@SafeVarargs public static <T> Iterable<T> mix(Iterable<T>... iterables)
public static <FROM,TO> Iterable<TO> map(org.neo4j.function.Function<? super FROM,? extends TO> function, Iterable<FROM> from)
public static <FROM,TO> Iterator<TO> map(org.neo4j.function.Function<? super FROM,? extends TO> function, Iterator<FROM> from)
public static <FROM,TO> Iterator<TO> flatMap(org.neo4j.function.Function<? super FROM,? extends Iterator<TO>> function, Iterator<FROM> from)
@SafeVarargs public static <T,C extends T> Iterable<T> iterable(C... items)
@SafeVarargs public static <T> Iterable<T> concat(Iterable<? extends T>... iterables)
@SafeVarargs public static <T> Iterator<T> concat(Iterator<? extends T>... iterables)
public static <T> ResourceIterator<T> concatResourceIterators(Iterator<ResourceIterator<T>> iterators)
public static <FROM,TO> org.neo4j.function.Function<FROM,TO> cast()
public static <T> ResourceIterable<T> asResourceIterable(Iterable<T> labels)
public static <T> ResourceIterable<T> asResourceIterable(ResourceIterator<T> it)
public static <T> ResourceIterable<T> iterable(org.neo4j.kernel.impl.transaction.log.IOCursor<T> cursor)
public static <T,C extends org.neo4j.cursor.Cursor> ResourceIterator<T> iterator(C resourceCursor, org.neo4j.function.Function<C,T> map)
public static <T> int indexOf(T itemToFind, Iterable<T> iterable)
T
- the type of the elementsitemToFind
- element to finditerable
- iterable to look for the element innull
if that was specified) or -1
public static <T> Iterable<T> option(T item)
public static <T,S extends Comparable> Iterable<T> sort(Iterable<T> iterable, org.neo4j.function.Function<T,S> compareFunction)
Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.