|
Watchmaker Framework for Evolutionary Computation API (Version 0.7.1) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.uncommons.watchmaker.framework.interactive.RendererAdapter<T,S>
T - The input type for the renderer.S - The output type for the renderer.public class RendererAdapter<T,S>
Adapter class for chaining together two renderers in series to provide
flexibility. For example, if we have a Long -> Date renderer that turns
a number of milliseconds since epoch into a Java date, and a Date -> String
renderer that converts a Java date into its String representation in a
particular locale, we can combine the two to create a Long -> String renderer
without having to write a separate implementation of the Renderer
interface.
| Constructor Summary | |
|---|---|
RendererAdapter(Renderer<T,? extends R> renderer1,
Renderer<R,S> renderer2)
Creates an adapter that feeds the output of renderer1 into renderer2. |
|
| Method Summary | |
|---|---|
S |
render(T entity)
Renders an object of one type as an instance of another. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RendererAdapter(Renderer<T,? extends R> renderer1,
Renderer<R,S> renderer2)
R - The intermediate type when transforming objects of type T to
objects of type S.renderer1 - A renderer that will translate an object of the input type
(T) into an object of the intermediate type (R).renderer2 - A renderer that will translate an object of the intermediate type
(R) into an object of the output type (S).| Method Detail |
|---|
public S render(T entity)
render in interface Renderer<T,S>entity - An object to render as a different type.
|
Watchmaker Framework for Evolutionary Computation API (Version 0.7.1) |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||