net.sourceforge.xwing
Class SimpleSourceSink

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

public class SimpleSourceSink
extends AbstractSourceSink

A SourceSink that internally stores any arbitrary Object as its value. If a new value is set via set(), a ChangeEvent wil be broadcast. If the value's internal state changes, though, no event will be broadcast because we have no generic way of knowing if that has happened.

Version:
$Revision: 1.3 $
Author:
Scott Howlett

Constructor Summary
SimpleSourceSink()
          Create a new SimpleSourceSink with a null value.
SimpleSourceSink(Object initialValue)
          Create a new SimpleSourceSink with the specified value.
 
Method Summary
 Object get()
          Return our stored value.
 void set(Object newValue)
          Set our stored value and fire a ChangeEvent to all listeners.
 
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

SimpleSourceSink

public SimpleSourceSink()
Create a new SimpleSourceSink with a null value.


SimpleSourceSink

public SimpleSourceSink(Object initialValue)
Create a new SimpleSourceSink with the specified value.

Parameters:
initialValue - The initial value.
Method Detail

get

public Object get()
Return our stored value.

Returns:
a value.

set

public void set(Object newValue)
Set our stored value and fire a ChangeEvent to all listeners.

Parameters:
newValue - 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.