net.sourceforge.xwing
Class FilteringSourceSink

java.lang.Object
  extended bynet.sourceforge.xwing.AbstractSourceSink
      extended bynet.sourceforge.xwing.FilteringSourceSink
All Implemented Interfaces:
SourceSink
Direct Known Subclasses:
BooleanToTextAdapter

public abstract class FilteringSourceSink
extends AbstractSourceSink

A SourceSink that gets and sets its values via another underlying SourceSink. FilteringSourceSink provides hooks for derived classes to transform the value between its own get/set interface and that of the underlying SourceSink. FilteringSourceSink is used as a base class for any SourceSink that provides some specific filtering behavior.

Version:
$Revision: 1.2 $
Author:
Scott Howlett

Constructor Summary
FilteringSourceSink(SourceSink srcSink)
          Create a new FilteringSourceSink
 
Method Summary
 Object get()
          Retrieve the value from the underlying SourceSink after passing it through the readFilter method.
protected abstract  Object readFilter(Object value)
          Transform a value on its way out from the underlying SourceSink.
 void set(Object value)
          Set the value in the underlying SourceSink after passing it through the writeFilter method.
protected abstract  Object writeFilter(Object value)
          Transform a value on its way into the underlying SourceSink.
 
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

FilteringSourceSink

public FilteringSourceSink(SourceSink srcSink)
Create a new FilteringSourceSink

Parameters:
srcSink - The underlying SourceSink.
Method Detail

get

public Object get()
Retrieve the value from the underlying SourceSink after passing it through the readFilter method.

Returns:
a value.

set

public void set(Object value)
Set the value in the underlying SourceSink after passing it through the writeFilter method.

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.

readFilter

protected abstract Object readFilter(Object value)
Transform a value on its way out from the underlying SourceSink.

Parameters:
value - The value read from the underlying SourceSink
Returns:
The value to be returned to the caller of this SourceSink's get() method.

writeFilter

protected abstract Object writeFilter(Object value)
Transform a value on its way into the underlying SourceSink.

Parameters:
value - The value passed in by the caller of this SourceSink's set() method.
Returns:
The value to be written into the underlying SourceSink.


Copyright © 2003 The Xwing Project. All Rights Reserved.