|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
SequenceAdapter
,
AdapterStrategy
Method Summary | |
---|---|
T |
adapt(S value)
Changes the representation of value from type E
to T . |
Method Detail |
---|
T adapt(S value)
value
from type E
to T
.
value
- The value; can be null, in which case null is
returned.
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |