![JAR search and dependency download from the Maven repository](/logo.png)
net.sf.javagimmicks.collections.transformer.package-info Maven / Gradle / Ivy
/**
* This package spans up the JavaGimmicks
* transformation API, which allows to create instances of the
* standard Java Collection API classes (and some more),
* that internally work with another form of elements as
* visible to the client. Let's use the terms
* internal format and external format for this
* two element formats.
*
* For example, you can create a {@code List} which is
* actually internally backed by a {@code List}. You
* wont't be aware of this fact and will think to work with
* a {@code List}. You can add, remove, get or set
* elements and of course iterate over them. The instance
* you are working on will automatically take care of transforming
* between the respective element types {@link java.lang.String} and
* {@link java.lang.Integer} and the results of all operations will be
* immediately visible in the internal {@link java.util.List}.
*
* Additionally, you could also think of a {@code List}
* which internally works with another {@code List}
* but keeps the elements in the reverse character order (for
* what reasons ever you like).
*
* Of course, in order to be able to work with transforming
* instances, you need to provide to them the transformation rules.
* This you can do by writing a class that implements the
* {@link net.sf.javagimmicks.collections.transformer.Transformer} or
* {@link net.sf.javagimmicks.collections.transformer.BidiTransformer} interface
* which are both contained in this API.
*
* When providing a {@link net.sf.javagimmicks.collections.transformer.Transformer},
* you will only be able to perform operations on the transforming instance that
* do not need to convert from the external format to the internal
* format. For example, you will be able to iterate over a
* {@link java.util.List}, get elements, remove them or ask if they are
* contained inside. But you will not be able to set or add elements
* (neither on the {@link java.util.List} nor on any of its
* {@link java.util.ListIterator}s. For more details, see below.
*
* When providing a {@link net.sf.javagimmicks.collections.transformer.BidiTransformer},
* all operations will be available and some operations will even be faster.
*
*
Decorator methods in {@link net.sf.javagimmicks.collections.transformer.TransformerUtils}
* This class provides a large number of methods {@code decorate()}
* (and {@code decorateKeyBased()} and {@code decorateValueBased()}
* for {@link java.util.Map}s) which can be used to create transformed instances
* of a number of (generic) base classes by providing an instance of this
* base class and one of {@link net.sf.javagimmicks.collections.transformer.Transformer} or
* {@link net.sf.javagimmicks.collections.transformer.BidiTransformer}.
*
* The resulting instance will implement the same interface (but
* eventually with different type parameters) and additionally
* {@link net.sf.javagimmicks.collections.transformer.Transforming} or
* {@link net.sf.javagimmicks.collections.transformer.BidiTransforming}
* (both depending on the provided transformation rule instance).
* Furthermore, this instance
* is completely backed on the the provided one and will contain
* no data itself. Any changes on it will affect the internal one and
* vice versa.
*
*
*
Operations on a transformed {@link java.util.Iterator}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* hasNext()
* supported
*
*
* next()
* supported
*
*
* remove()
* supported
*
*
*
*
*
* Operations on a transformed {@link java.util.Collection}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* add()
* not supported
* supported
*
*
* addAll()
* not supported
* supported
*
*
* clear()
* supported
*
*
* contains()
* supported; needs {@code equals()} method
*
*
* containsAll()
* supported; needs {@code equals()} method
*
*
* isEmpty()
* supported
*
*
* iterator()
* supported; See {@code Iterator} operations
*
*
* remove()
* supported; needs {@code equals()} method
*
*
* removeAll()
* supported; needs {@code equals()} method
*
*
* retainAll()
* supported; needs {@code equals()} method
*
*
* size()
* supported
*
*
* toArray()
* supported
*
*
*
*
*
* Operations on a transformed {@link java.util.Set}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* add()
* not supported
* supported
*
*
* addAll()
* not supported
* supported
*
*
* clear()
* supported
*
*
* contains()
* supported; needs {@code equals()} method
* supported; faster
*
*
* containsAll()
* supported; needs {@code equals()} method
* supported; faster
*
*
* isEmpty()
* supported
*
*
* iterator()
* supported; See {@code Iterator} operations
*
*
* remove()
* supported; needs {@code equals()} method
* supported; faster
*
*
* removeAll()
* supported; needs {@code equals()} method
* supported; faster
*
*
* retainAll()
* supported; needs {@code equals()} method
* supported; faster
*
*
* size()
* supported
*
*
* toArray()
* supported
*
*
*
*
*
* Operations on a transformed {@link java.util.SortedSet}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* {@link java.util.Set} operations
* See table for {@code Set} operations
*
*
* comparator()
* not supported
* supported
*
*
* first()
* supported
*
*
* headSet()
* not supported
* supported
*
*
* last()
* supported
*
*
* subSet()
* not supported
* supported
*
*
* tailSet()
* not supported
* supported
*
*
*
*
*
* Operations on a transformed {@link java.util.NavigableSet}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* {@link java.util.Set} operations
* See table for {@code Set} operations
*
*
* {@link java.util.SortedSet} operations
* See table for {@code SortedSet} operations
*
*
* ceiling()
* not supported
* supported
*
*
* descendingIterator()
* supported
*
*
* descendingSet()
* supported
*
*
* floor()
* not supported
* supported
*
*
* headSet()
* not supported
* supported
*
*
* higher()
* not supported
* supported
*
*
* lower()
* not supported
* supported
*
*
* pollFirst()
* supported
*
*
* pollLast()
* supported
*
*
* subSet()
* not supported
* supported
*
*
* tailSet()
* not supported
* supported
*
*
*
*
*
* Operations on a transformed {@link java.util.ListIterator}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* {@link java.util.Iterator} operations
* See table for {@code Iterator} operations
*
*
* add()
* not supported
* supported
*
*
* hasPrevious()
* supported
*
*
* nextIndex()
* supported
*
*
* previous()
* supported
*
*
* previousIndex()
* supported
*
*
* set()
* not supported
* supported
*
*
*
*
*
* Operations on a transformed {@link java.util.List}
*
*
*
* Operation
* Transformer
* BidiTransformer
*
*
*
*
* {@link java.util.Collection} operations
* See table for {@code Collection} operations
*
*
* add()
* not supported
* supported
*
*
* addAll()
* not supported
* supported
*
*
* get()
* supported
*
*
* indexOf()
* supported; needs {@code equals()} method
*
*
* lastIndexOf()
* supported; needs {@code equals()} method
*
*
* listIterator()
* supported; See {@code ListIterator} operations
*
*
* remove()
* supported
*
*
* set()
* not supported
* supported
*
*
* subList()
* supported (with same behaviour)
*
*
*
*
* @author Michael Scholz
*/
package net.sf.javagimmicks.collections.transformer;