|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ObjectTransform
Transforms one object into another. This interface defines a single method, that takes one object and returns another, different object that is somehow derived from it. Said derivation is, of course, up to the implementation, but must not modify or destroy any portion of the input object. However, it is permissible to reuse portions of the input object by reference (e.g., when transforming one list into another, you could create a new list that directly contained the contents of the first list, but you can't reorder or change the contents of the first list).
Another popular technique is to output wrapper objects that do some strange thing to the original victim on the fly. Any behavior like this should be explictly mentioned however.
Both of those examples show how a change to the original may affect or even invalidate the new version. Tough - if you don't want that to happen, clone it first.
| Method Summary | |
|---|---|
java.lang.Object |
transform(java.lang.Object victim)
Our one method; this transforms one object into another. |
| Method Detail |
|---|
java.lang.Object transform(java.lang.Object victim)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||