org.robokind.api.common.utils
Class PolymorphicAdapter<A,B>

java.lang.Object
  extended by org.robokind.api.common.utils.PolymorphicAdapter<A,B>
All Implemented Interfaces:
Adapter<A,B>

public class PolymorphicAdapter<A,B>
extends Object
implements Adapter<A,B>

Author:
Matthew Stevenson

Nested Class Summary
static interface PolymorphicAdapter.AdapterKeyMap<T>
           
 
Constructor Summary
PolymorphicAdapter(PolymorphicAdapter.AdapterKeyMap<A> keyMap)
           
 
Method Summary
 B adapt(A a)
          Adapts the given instance.
 void addAdapter(String adaptClass, Adapter<A,B> adapter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolymorphicAdapter

public PolymorphicAdapter(PolymorphicAdapter.AdapterKeyMap<A> keyMap)
Method Detail

addAdapter

public void addAdapter(String adaptClass,
                       Adapter<A,B> adapter)

adapt

public B adapt(A a)
Description copied from interface: Adapter
Adapts the given instance.

Specified by:
adapt in interface Adapter<A,B>
Parameters:
a - instance to adapt
Returns:
an instance of B from the given instance of A.


Copyright © 2011-2012. All Rights Reserved.