@FunctionalInterface
public interface IterableCollection<T>
extends java.util.Collection<T>
Collection
view of an Iterable
, requiring only Iterable.iterator()
to be implemented in
order to present a full Collection
. This interface is thus a functional interface of Iterable
's
Iterable.iterator()
method. All methods are implemented through Iterator
traversal of the underlying
Iterable
. All methods are supported except add(Object)
and addAll(Collection)
.Modifier and Type | Method and Description |
---|---|
default boolean |
add(T t) |
default boolean |
addAll(java.util.Collection<? extends T> c) |
default void |
clear() |
default boolean |
contains(java.lang.Object o) |
default boolean |
containsAll(java.util.Collection<?> c) |
static <T> java.util.Collection<T> |
empty() |
static <T> java.util.Collection<T> |
from(java.lang.Iterable<T> iterable) |
default boolean |
isEmpty() |
static <T> java.util.Collection<T> |
of(T... ts) |
static <T> java.util.Collection<T> |
of(T t) |
default boolean |
remove(java.lang.Object o) |
default boolean |
removeAll(java.util.Collection<?> c) |
default boolean |
retainAll(java.util.Collection<?> c) |
default int |
size() |
default java.util.Spliterator<T> |
spliterator() |
default java.lang.Object[] |
toArray() |
default <T1> T1[] |
toArray(T1[] a) |
static <T> java.util.Collection<T> empty()
static <T> java.util.Collection<T> of(T t)
@SafeVarargs static <T> java.util.Collection<T> of(T... ts)
static <T> java.util.Collection<T> from(java.lang.Iterable<T> iterable)
default int size()
size
in interface java.util.Collection<T>
default boolean isEmpty()
isEmpty
in interface java.util.Collection<T>
default boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<T>
default java.lang.Object[] toArray()
toArray
in interface java.util.Collection<T>
default <T1> T1[] toArray(T1[] a)
toArray
in interface java.util.Collection<T>
default boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<T>
default boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<T>
default boolean addAll(java.util.Collection<? extends T> c)
addAll
in interface java.util.Collection<T>
default boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<T>
default boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<T>
default void clear()
clear
in interface java.util.Collection<T>