net.sourceforge.xwing
Interface SourceSink

All Known Implementing Classes:
AbstractSourceSink, NodeTextSourceSink

public interface SourceSink

A proxy for some value that can be read and written, and to which interested listeners may subscribe to receive change notification. SourceSink serves a similar function to the Swing ListModel and TreeModel classes in that it abstracts notions of reading, modifying, and change notification away from the value objects themselves. But where ListModel and TreeModel perform this function for values organized in list or tree form, SourceSink provides it for individual values.

Version:
$Revision: 1.3 $
Author:
Scott Howlett

Method Summary
 void addChangeListener(ChangeListener l)
          Add the specified listener to the list of interested change listeners.
 Object get()
          Retrieve some value.
 void removeChangeListener(ChangeListener l)
          Remove the specified listener from the list of interested change listeners.
 void set(Object value)
          Store some value.
 

Method Detail

get

public Object get()
Retrieve some value.

Returns:
a value.

set

public void set(Object value)
Store some value.

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.

addChangeListener

public void addChangeListener(ChangeListener l)
Add the specified listener to the list of interested change listeners. In general, whenever our value changes (either a new value is set via the set() method or the existing value's internal state changes), all subscribed listeners are notified with a ChangeEvent.

Parameters:
l - The listener to add.

removeChangeListener

public void removeChangeListener(ChangeListener l)
Remove the specified listener from the list of interested change listeners.

Parameters:
l - The listener to remove.


Copyright © 2003 The Xwing Project. All Rights Reserved.