SortedBag to transform objects that are added.
The add methods are affected by this class. Thus objects must be removed or searched for using their transformed form. For example, if the transformation converts Strings to Integers, you must use the Integer form to remove objects.
This class is Serializable from Commons Collections 3.1.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| protected | TransformedSortedBag(final SortedBag<E>
the bag to decorate, must not be null bag, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public Comparator | comparator()
Implements org. |
| public E | first()
Implements org. |
| protected SortedBag | |
| public E | |
| public static < the type of the elements in the bag E> TransformedSortedBag | Returns: a new transformed SortedBagthe bag to decorate, must not be null bag, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Factory method to create a transforming sorted bag that will transform existing contents of the specified sorted bag. |
| public static < the type of the elements in the bag E> TransformedSortedBag | Returns: a new transformed SortedBagthe bag to decorate, must not be null bag, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Factory method to create a transforming sorted bag. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| TransformedSortedBag | back to summary |
|---|---|
| protected TransformedSortedBag(final SortedBag<E> bag, final Transformer<? super E, ? extends E> transformer) Constructor that wraps (not copies). If there are any elements already in the bag being decorated, they are NOT transformed.
| |
| comparator | back to summary |
|---|---|
| public Comparator Implements org. Doc from org. Returns the comparator associated with this sorted set, or null if it uses its elements' natural ordering.
| |
| first | back to summary |
|---|---|
| public E first() Implements org. Doc from org. Returns the first (lowest) member.
| |
| getSortedBag | back to summary |
|---|---|
| protected SortedBag Gets the decorated bag.
| |
| last | back to summary |
|---|---|
| public E last() Implements org. Doc from org. Returns the last (highest) member.
| |
| transformedSortedBag | back to summary |
|---|---|
| public static <E> TransformedSortedBag Factory method to create a transforming sorted bag that will transform existing contents of the specified sorted bag.
If there are any elements already in the bag being decorated, they
will be transformed by this method.
Contrast this with
| |
| transformingSortedBag | back to summary |
|---|---|
| public static <E> TransformedSortedBag Factory method to create a transforming sorted bag.
If there are any elements already in the bag being decorated, they
are NOT transformed. Contrast this with
| |