SortedBag to comply with the Collection contract.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| public | CollectionSortedBag(final SortedBag<E>
the sorted bag to decorate, must not be null bag)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(final E
the object to add object)Overrides org. Implements org. |
| public boolean | add(final E
the object to add object, final int the number of copies to add count)Overrides org. Implements org. nCopies copies of the specified object to the Bag.
|
| public boolean | addAll(final Collection<? extends E>
collection containing elements to be added to this collection coll)Overrides org. Implements java. |
| public static < the type of the elements in the bag E> SortedBag | Returns: a SortedBag that complies to the Collection contractthe sorted bag to decorate, must not be null bag)Factory method to create a sorted bag that complies to the Collection contract. |
| public boolean | containsAll(final Collection<?>
the collection to check against coll)Overrides org. Implements org. true if the bag contains all elements in
the given collection, respecting cardinality.
|
| private void | readObject(final ObjectInputStream
the input stream in)Read the collection in using a custom routine. |
| public boolean | remove(final Object
the object to remove object)Overrides org. Implements org. |
| public boolean | removeAll(final Collection<?>
the collection to remove coll)Overrides org. Implements org. |
| public boolean | retainAll(final Collection<?>
the collection to retain coll)Overrides org. Implements org. |
| private void | writeObject(final ObjectOutputStream
the output stream out)Write the collection out using a custom routine. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| CollectionSortedBag | back to summary |
|---|---|
| public CollectionSortedBag(final SortedBag<E> bag) Constructor that wraps (not copies).
| |
| add | back to summary |
|---|---|
| public boolean add(final E object) Overrides org. Implements org. Doc from org. (Violation) Adds one copy of the specified object to the Bag.
If the object is already in the
Since this method always increases the size of the bag,
according to the
| |
| add | back to summary |
|---|---|
| public boolean add(final E object, final int count) Overrides org. Implements org. Doc from org. Adds
If the object is already in the
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(final Collection<? extends E> coll) Overrides org. 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.
| |
| collectionSortedBag | back to summary |
|---|---|
| public static <E> SortedBag Factory method to create a sorted bag that complies to the Collection contract.
| |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(final Collection<?> coll) Overrides org. Implements org. Doc from org. (Violation)
Returns
The
| |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException Read the collection in using a custom routine.
| |
| remove | back to summary |
|---|---|
| public boolean remove(final Object object) Overrides org. Implements org. Doc from org. (Violation) Removes all occurrences of the given object from the bag.
This will also remove the object from the
According to the | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(final Collection<?> coll) Overrides org. Implements org. Doc from org. (Violation)
Remove all elements represented in the given collection,
respecting cardinality. That is, if the given collection
The
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(final Collection<?> coll) Overrides org. Implements org. Doc from org. (Violation)
Remove any members of the bag that are not in the given
collection, respecting cardinality. That is, if the given
collection
The
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(final ObjectOutputStream out) throws IOException Write the collection out using a custom routine.
| |