E - type of the elements in this collectionpublic interface MutableCollection<E> extends BaseCollection<E>
BaseCollection.
This interface extends the BaseCollection interface by providing
additional methods for adding elements to the collection.
BaseCollection| Modifier and Type | Method and Description |
|---|---|
boolean |
addAllIterable(Iterable<? extends E> elements)
Adds all elements of the given
Iterable to this collection. |
boolean |
addWithNullMessage(E e,
Object nullMessage)
Adds the specified element
e to this collection or throws a
NullPointerException if the element is null. |
boolean |
addWithNullMessage(E e,
Object nullMessageStart,
int index,
Object nullMessageEnd)
Adds the specified element
e to this collection or throws a
NullPointerException if the element is null. |
add, addAll, contains, getOnly, iterator, remove, removeAll, retainAllclear, contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArrayboolean addAllIterable(Iterable<? extends E> elements)
Iterable to this collection.
Elements are added in the order they are returned by the given iterable's
iterator. If the iterator returns a null element then this method
does not return and throws a NullPointerException instead.
elements - the elements to be added to this collectiontrue if this collection changed as a result of this
operationboolean addWithNullMessage(E e, Object nullMessage)
e to this collection or throws a
NullPointerException if the element is null.
If a NullPointerException is to be thrown, the nullMessage
value is used as the exception's message.
Typical usage:
coll.addWithNullMessage(value, "value == null");
e - an element to be added to this collectionnullMessage - the NullPointerException messagetrue if this collection changed as a result of this
operationboolean addWithNullMessage(E e, Object nullMessageStart, int index, Object nullMessageEnd)
e to this collection or throws a
NullPointerException if the element is null.
If a NullPointerException is to be thrown, the concatenation of
nullMessageStart, index and nullMessageEnd is
used as the exception's message.
Typical usage:
coll.addWithNullMessage(element, "elements[", index, "] == null");
e - an element to be added to this collectionnullMessageStart - the first part of the NullPointerException messageindex - the second part of the NullPointerException messagenullMessageEnd - the third part of the NullPointerException messagetrue if this collection changed as a result of this
operationCopyright © 2021–2022 Objectos Software LTDA. All rights reserved.