Evaluating Software Design Patterns
— the "Gang of Four" patterns implemented in Java 6

Interface AdapterDelegate<S,T>

Type Parameters:
S - The adaptee type adapted by this adapter delegate.
T - The adapted (target) type delivered by this adapter delegate.

public interface AdapterDelegate<S,T>

An adapter delegate determines how a value of type S can be represented as type T.

Adapter delegation normally imply a strategy of simple representation shift, and that the value represented as E and T are logically equivalent. This is not a requirement, however, and cannot be guaranteed.

Implementation notes:
This interface represents a pluggable adapter as described by Gamma et al. [Gamma95, p.144-145]. It is primarily used for sequence adapters, but can in theory adapt any two types. As a simple representation shift between types is normally implied, the Strategy pattern can be used to implement reusable adaptations.

Gunni Rode / rode.dk
See Also:
SequenceAdapter, AdapterStrategy

Method Summary
 T adapt(S value)
          Changes the representation of value from type E to T.

Method Detail


T adapt(S value)
Changes the representation of value from type E to T.

value - The value; can be null, in which case null is returned.
The value represented as type T; can be null.

Gunni Rode / rode.dk

Feel free to use and/or modify the Java 6 source code developed for this thesis AT YOUR OWN RISK, but note that the source code comes WITHOUT ANY — and I do mean WITHOUT ANY — form of warranty WHAT SO EVER!

The original thesis and source code are available at rode.dk/thesis.