Set 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 | TransformedSet(final Set<E>
the set to decorate, must not be null set, 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 boolean | equals(final Object
object to be compared for equality with this set object)Overrides java. Implements java. |
| public int | hashCode()
Overrides java. Implements java. |
| public static < the element type E> Set | Returns: a new transformed setthe set to decorate, must not be null set, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Factory method to create a transforming set that will transform existing contents of the specified set. |
| public static < the element type E> TransformedSet | Returns: a new transformed setthe set to decorate, must not be null set, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Factory method to create a transforming set. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| TransformedSet | back to summary |
|---|---|
| protected TransformedSet(final Set<E> set, final Transformer<? super E, ? extends E> transformer) Constructor that wraps (not copies). If there are any elements already in the set being decorated, they are NOT transformed.
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object object) Overrides java. Implements java. Doc from java. Compares the specified object with this set for equality. Returns
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this set. The hash code of a set is
defined to be the sum of the hash codes of the elements in the set,
where the hash code of a
| |
| transformedSet | back to summary |
|---|---|
| public static <E> Set Factory method to create a transforming set that will transform existing contents of the specified set.
If there are any elements already in the set being decorated, they
will be transformed by this method.
Contrast this with
| |
| transformingSet | back to summary |
|---|---|
| public static <E> TransformedSet Factory method to create a transforming set.
If there are any elements already in the set being decorated, they
are NOT transformed.
Contrast this with
| |