T - the type of the collection's elements.public interface ICollection<T> extends IEnumerable<T>, Collection<T>
Collections that also provide an enumerator.
Also contains some default implementations which facilitate handling of Collections.| Modifier and Type | Field and Description |
|---|---|
static ICollection |
EMPTY
An
ICollection that is always empty. |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
addAll(Collection<? extends T> other) |
default boolean |
containsAll(Collection<? extends Object> other) |
default boolean |
isEmpty() |
default Iterator<T> |
iterator() |
default Stream<T> |
parallelStream()
Returns a parallel
Stream using the elements of this enumerable. |
default boolean |
remove(Object other) |
default boolean |
removeAll(Collection<? extends Object> other) |
default boolean |
retainAll(Collection<? extends Object> other) |
default Stream<T> |
stream()
Returns a sequential
Stream using the elements of this enumerable. |
default Object[] |
toArray() |
default <K> K[] |
toArray(K[] a) |
concat, concat, create, create, enumeratoradd, clear, contains, equals, hashCode, removeIf, size, spliteratorstatic final ICollection EMPTY
ICollection that is always empty.default boolean addAll(Collection<? extends T> other)
addAll in interface Collection<T>default boolean containsAll(Collection<? extends Object> other)
containsAll in interface Collection<T>default boolean isEmpty()
isEmpty in interface Collection<T>default Iterator<T> iterator()
iterator in interface Collection<T>iterator in interface IEnumerable<T>iterator in interface Iterable<T>default Stream<T> parallelStream()
Stream using the elements of this enumerable.parallelStream in interface Collection<T>parallelStream in interface IEnumerable<T>Stream using the elements of this enumerable.default boolean remove(Object other)
remove in interface Collection<T>default boolean removeAll(Collection<? extends Object> other)
removeAll in interface Collection<T>default boolean retainAll(Collection<? extends Object> other)
retainAll in interface Collection<T>default Stream<T> stream()
Stream using the elements of this enumerable.stream in interface Collection<T>stream in interface IEnumerable<T>Stream using the elements of this enumerable.default Object[] toArray()
toArray in interface Collection<T>default <K> K[] toArray(K[] a)
toArray in interface Collection<T>