net.sourceforge.xwing
Class MapSourceSink

java.lang.Object
  extended bynet.sourceforge.xwing.AbstractSourceSink
      extended bynet.sourceforge.xwing.MapSourceSink
All Implemented Interfaces:
SourceSink

public class MapSourceSink
extends AbstractSourceSink

A SourceSink whose value is retrieved from and written to a Map using a specified key.

Version:
$Revision: 1.3 $
Author:
Scott Howlett

Constructor Summary
MapSourceSink(Map map, Object key)
          Create a new MapSourceSink.
 
Method Summary
 Object get()
          Retrieve the value from the map using the key specified when we were constructed.
 void set(Object value)
          Store the value into the map using the key specified when we were constructed.
 
Methods inherited from class net.sourceforge.xwing.AbstractSourceSink
addChangeListener, fireStateChanged, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapSourceSink

public MapSourceSink(Map map,
                     Object key)
Create a new MapSourceSink.

Parameters:
map - The map containing our value.
key - The key that should be used in the map when getting and setting our value
Method Detail

get

public Object get()
Retrieve the value from the map using the key specified when we were constructed.

Returns:
a value.

set

public void set(Object value)
Store the value into the map using the key specified when we were constructed.

Parameters:
value - The value to be stored. In general, if a value is stored via set(), the value retrieved by a subsequent get() call will equal the set value as defined by the value's equals() method.


Copyright © 2003 The Xwing Project. All Rights Reserved.