net.sf.doolin.gui.display
Class MapStateAdapter<S>

java.lang.Object
  extended by net.sf.doolin.gui.display.AbstractStateAdapter<S>
      extended by net.sf.doolin.gui.display.MapStateAdapter<S>
Type Parameters:
S - Type of the source
All Implemented Interfaces:
StateAdapter<S>, Adapter<S,DisplayState>

public class MapStateAdapter<S>
extends AbstractStateAdapter<S>

Adapter based on a map.

Author:
Damien Coraboeuf

Constructor Summary
MapStateAdapter()
           
 
Method Summary
 DisplayState convertSubjectToTarget(S subjectValue)
          Conversion from the subject to the target
 DisplayState getDefaultState()
          Gets the default state.
 Map<S,DisplayState> getMap()
          Gets the map.
 void setDefaultState(DisplayState defaultState)
          Default state when not mapped
 void setMap(Map<S,DisplayState> map)
          Map of subject values to the display state
 
Methods inherited from class net.sf.doolin.gui.display.AbstractStateAdapter
convertTargetToSubject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapStateAdapter

public MapStateAdapter()
Method Detail

getDefaultState

public DisplayState getDefaultState()
Gets the default state.

Returns:
the default state

setDefaultState

public void setDefaultState(DisplayState defaultState)
Default state when not mapped

Parameters:
defaultState - the new default state

getMap

public Map<S,DisplayState> getMap()
Gets the map.

Returns:
the map

setMap

public void setMap(Map<S,DisplayState> map)
Map of subject values to the display state

Parameters:
map - the map

convertSubjectToTarget

public DisplayState convertSubjectToTarget(S subjectValue)
Description copied from interface: Adapter
Conversion from the subject to the target

Parameters:
subjectValue - Subject value
Returns:
Target value


Copyright © 2011. All Rights Reserved.