| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(T t)
Implements java. Ensures that this collection contains the specified element (optional operation). |
| public boolean | addAll(Collection<? extends T> collection)
Implements java. Adds all of the elements in the specified collection to this collection (optional operation). |
| public Collection | castToCollection()
Implements org. This can be overridden in most implementations to just return this. |
| public RichIterable | chunk(int size)
Implements org. Partitions elements in fixed size chunks. |
| public void | clear()
Implements java. Removes all of the elements from this collection (optional operation). |
| public <V> ImmutableBag | countBy(Function<? super T, ? extends V> function)
Overrides default org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection. |
| public <V> ImmutableBag | countByEach(Function<? super T, ? extends Iterable<V>> function)
Overrides org. Overrides default org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection. |
| public <V, P> ImmutableBag | countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
Overrides default org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument. |
| public <V> ImmutableMap | groupByUniqueKey(Function<? super T, ? extends V> function)
Overrides default org. Implements org. For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key. |
| protected abstract MutableCollection | |
| public Stream | parallelStream()
Overrides default org. Returns a possibly parallel |
| public Optional | reduce(BinaryOperator<T> accumulator)
Overrides default org. This method produces the equivalent result as |
| public boolean | remove(Object o)
Implements java. Removes a single instance of the specified element from this collection, if it is present (optional operation). |
| public boolean | removeAll(Collection<?> collection)
Implements java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). |
| protected void | |
| public boolean | retainAll(Collection<?> collection)
Implements java. Retains only the elements in this collection that are contained in the specified collection (optional operation). |
| public Spliterator | spliterator()
Overrides default org. Creates a |
| public Stream | stream()
Overrides default org. Returns a sequential |
| public <V> ImmutableObjectDoubleMap | sumByDouble(Function<? super T, ? extends V> groupBy, DoubleFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public <V> ImmutableObjectDoubleMap | sumByFloat(Function<? super T, ? extends V> groupBy, FloatFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public <V> ImmutableObjectLongMap | sumByInt(Function<? super T, ? extends V> groupBy, IntFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public <V> ImmutableObjectLongMap | sumByLong(Function<? super T, ? extends V> groupBy, LongFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public Object[] | toArray()
Overrides default org. Implements java. Returns an array containing all of the elements in this collection. |
| public <E> E[] | toArray(E[] array)
Overrides default org. Implements java. Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. |
| AbstractImmutableCollection | back to summary |
|---|---|
| public AbstractImmutableCollection() | |
| add | back to summary |
|---|---|
| public boolean add(T t) Implements java. Doc from java. Ensures that this collection contains the specified element (optional
operation). Returns
Collections that support this operation may place limitations on what
elements may be added to this collection. In particular, some
collections will refuse to add
If a collection refuses to add a particular element for any reason
other than that it already contains the element, it must throw
an exception (rather than returning
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends T> collection) Implements java. Doc from java. Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) If the specified collection has a defined encounter order, processing of its elements generally occurs in that order.
| |
| castToCollection | back to summary |
|---|---|
| public Collection Implements org. Doc from org. This can be overridden in most implementations to just return this.
| |
| chunk | back to summary |
|---|---|
| public RichIterable Implements org. Doc from org. Partitions elements in fixed size chunks.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the elements from this collection (optional operation). The collection will be empty after this method returns.
| |
| countBy | back to summary |
|---|---|
| public <V> ImmutableBag Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
| |
| countByEach | back to summary |
|---|---|
| public <V> ImmutableBag Overrides org. Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
| |
| countByWith | back to summary |
|---|---|
| public <V, P> ImmutableBag Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.
| |
| groupByUniqueKey | back to summary |
|---|---|
| public <V> ImmutableMap Overrides default org. Implements org. Doc from org. For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key. The generated keys must each be unique, or else an exception is thrown.
| |
| newMutable | back to summary |
|---|---|
| protected abstract MutableCollection | |
| parallelStream | back to summary |
|---|---|
| public Stream Overrides default org. Doc from java. Returns a possibly parallel This method should be overridden when the
| |
| reduce | back to summary |
|---|---|
| public Optional Overrides default org. Doc from org. This method produces the equivalent result as
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Implements java. Doc from java. Removes a single instance of the specified element from this
collection, if it is present (optional operation). More formally,
removes an element
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> collection) Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
| |
| removeAllFrom | back to summary |
|---|---|
| protected void removeAllFrom(Iterable<? extends T> elements, MutableCollection<T> result) | |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> collection) Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
| |
| spliterator | back to summary |
|---|---|
| public Spliterator Overrides default org. Doc from java. Creates a The default implementation should be overridden by subclasses that
can return a more efficient spliterator. In order to
preserve expected laziness behavior for the
These requirements ensure that streams produced by the
| |
| stream | back to summary |
|---|---|
| public Stream Overrides default org. Doc from java. Returns a sequential This method should be overridden when the
| |
| sumByDouble | back to summary |
|---|---|
| public <V> ImmutableObjectDoubleMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| sumByFloat | back to summary |
|---|---|
| public <V> ImmutableObjectDoubleMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| sumByInt | back to summary |
|---|---|
| public <V> ImmutableObjectLongMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| sumByLong | back to summary |
|---|---|
| public <V> ImmutableObjectLongMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Overrides default org. Implements java. Doc from java. Returns an array containing all of the elements in this collection.
If this collection makes any guarantees as to what order its elements
are returned by its iterator, this method must return the elements in
the same order. The returned array's runtime component type is The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
| |
| toArray | back to summary |
|---|---|
| public <E> E[] toArray(E[] array) Overrides default org. Implements java. Doc from java. Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection. If this collection fits in the specified array with room to spare
(i.e., the array has more elements than this collection), the element
in the array immediately following the end of the collection is set to
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
| |