Package com.palantir.common.collect
Class IterableView<T>
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.palantir.common.collect.IterableView<T>
-
-
Constructor Summary
Constructors Constructor Description IterableView()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
all(com.google.common.base.Predicate<? super T> predicate)
boolean
any(com.google.common.base.Predicate<? super T> predicate)
IterableView<T>
concat(Iterable<? extends T> b)
IterableView<T>
concat(Iterable<? extends T>... inputs)
IterableView<T>
concat(Iterable<? extends T> b, Iterable<? extends T> c)
IterableView<T>
consumingIterable()
boolean
contains(Object element)
<S extends Collection<? super T>>
ScopyInto(S collection)
Copies the current contents of this set view into an existing collection.IterableView<T>
cycle()
protected abstract Iterable<? extends T>
delegate()
IterableView<T>
filter(com.google.common.base.Predicate<? super T> predicate)
<U> IterableView<U>
filter(Class<? extends U> type)
T
find(com.google.common.base.Predicate<? super T> predicate)
int
frequency(Object element)
T
get(int position)
T
get(int position, T defaultValue)
T
getFirst()
T
getLast()
T
getLast(T defaultValue)
T
getOnlyElement()
T
getOnlyElement(T defaultValue)
com.google.common.collect.ImmutableList<T>
immutableCopy()
Returns an immutable copy of the current contents of this iterable view.com.google.common.collect.ImmutableSet<T>
immutableSetCopy()
Returns an immutable copy of the current contents of this iterable view.boolean
isEmpty()
Iterator<T>
iterator()
IterableView<T>
limit(int limitSize)
static <T> IterableView<T>
of(Iterable<? extends T> it)
static <T> IterableView<T>
of(T... elements)
IterableView<List<T>>
partition(int size)
int
size()
IterableView<T>
skip(int numberToSkip)
Spliterator<T>
spliterator()
Stream<T>
stream()
Returns a sequentialStream
with the contents as its source.String
toString()
<U> IterableView<U>
transform(com.google.common.base.Function<? super T,? extends U> function)
IterableView<T>
unmodifiableIterable()
-
-
-
Method Detail
-
delegate
protected abstract Iterable<? extends T> delegate()
- Specified by:
delegate
in classcom.google.common.collect.ForwardingObject
-
of
public static <T> IterableView<T> of(Iterable<? extends T> it)
-
of
public static <T> IterableView<T> of(T... elements)
-
concat
public IterableView<T> concat(Iterable<? extends T>... inputs)
-
concat
public IterableView<T> concat(Iterable<? extends T> b)
-
filter
public IterableView<T> filter(com.google.common.base.Predicate<? super T> predicate)
-
filter
public <U> IterableView<U> filter(Class<? extends U> type)
-
transform
public <U> IterableView<U> transform(com.google.common.base.Function<? super T,? extends U> function)
-
skip
public IterableView<T> skip(int numberToSkip)
-
limit
public IterableView<T> limit(int limitSize)
-
consumingIterable
public IterableView<T> consumingIterable()
-
cycle
public IterableView<T> cycle()
-
unmodifiableIterable
public IterableView<T> unmodifiableIterable()
-
partition
public IterableView<List<T>> partition(int size)
-
contains
public boolean contains(@Nullable Object element)
-
frequency
public int frequency(@Nullable Object element)
-
size
public int size()
-
all
public boolean all(com.google.common.base.Predicate<? super T> predicate)
-
any
public boolean any(com.google.common.base.Predicate<? super T> predicate)
-
isEmpty
public boolean isEmpty()
-
get
public T get(int position)
-
getLast
public T getLast()
-
getOnlyElement
public T getOnlyElement()
-
getFirst
public T getFirst()
-
immutableCopy
public com.google.common.collect.ImmutableList<T> immutableCopy()
Returns an immutable copy of the current contents of this iterable view. Does not support null elements.
-
immutableSetCopy
public com.google.common.collect.ImmutableSet<T> immutableSetCopy()
Returns an immutable copy of the current contents of this iterable view. Does not support null elements.
-
copyInto
public <S extends Collection<? super T>> S copyInto(S collection)
Copies the current contents of this set view into an existing collection. This method has equivalent behavior toIterables.addAll(collection, this)
.- Returns:
- a reference to
set
, for convenience
-
spliterator
public Spliterator<T> spliterator()
- Specified by:
spliterator
in interfaceIterable<T>
-
toString
public String toString()
- Overrides:
toString
in classcom.google.common.collect.ForwardingObject
-
-