org.tbull.util
Interface Mapper<I,O>

Type Parameters:
I - The type of the input elements.
O - The type of the output elements.
All Known Implementing Classes:
Mapper.IdentityMapper

public interface Mapper<I,O>

A translation in the mapping process. Classes implementing this interface provide the translation for one element from its original (input) type to the target (output) type. See the map family of functions in Collections.

A mapper has no state. That is, the result of the map(Object) translation is based solely on the element passed, not on when it is translated. In other words, the outcome does not depend, for example, on it's position in the input list, and the result must be consistently the same for multiple invocations, provided no relevant information in the element is modified.


Nested Class Summary
static class Mapper.IdentityMapper<E>
          A Mapper that maps according to an identity function.
 
Method Summary
 O map(I element)
          Maps the element under translation from its original (input) type to the target (output) type of the mapping process.
 

Method Detail

map

O map(I element)
Maps the element under translation from its original (input) type to the target (output) type of the mapping process.

Parameters:
element - The element to be translated.
Returns:
The translated element.