dsto.dfc.swt.forms
Class TranslatorPipe

java.lang.Object
  extended by dsto.dfc.swt.forms.AbstractPipe
      extended by dsto.dfc.swt.forms.AbstractBiDiPipe
          extended by dsto.dfc.swt.forms.TranslatorPipe
All Implemented Interfaces:
Pipe, Disposable

public class TranslatorPipe
extends AbstractBiDiPipe
implements Pipe

A pipe that outputs a transformed version of its input using a ITranslator.

Version:
$Revision$
Author:
mpp

Field Summary
 
Fields inherited from class dsto.dfc.swt.forms.AbstractBiDiPipe
childPipe
 
Fields inherited from class dsto.dfc.swt.forms.AbstractPipe
errorHandler, parent
 
Constructor Summary
TranslatorPipe(IStringTranslator translator)
          Create a new instance using an IStringTranslator to convert to string for input and back again for output.
TranslatorPipe(ITranslator inputTranslator, ITranslator outputTranslator)
          Create a new instance.
 
Method Summary
 void dispose()
          Forwarded to the child pipe.
 boolean input(Object value)
          Input a value into the pipe tree.
 boolean isDisposed()
          Test if pipe has been disposed.
 boolean output(Object value)
          Output a value from a child into the pipe (the reverse of input ()).
 
Methods inherited from class dsto.dfc.swt.forms.AbstractBiDiPipe
connect, flush, setErrorHandler
 
Methods inherited from class dsto.dfc.swt.forms.AbstractPipe
getParent, handlePipeError, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dsto.dfc.swt.forms.Pipe
connect, flush, getParent, setErrorHandler, setParent
 

Constructor Detail

TranslatorPipe

public TranslatorPipe(IStringTranslator translator)
Create a new instance using an IStringTranslator to convert to string for input and back again for output.

Parameters:
translator - The string translator.
See Also:
IStringTranslator.ToString, IStringTranslator.FromString

TranslatorPipe

public TranslatorPipe(ITranslator inputTranslator,
                      ITranslator outputTranslator)
Create a new instance.

Parameters:
inputTranslator - Translator for the input direction. May be null for no input (i.e. read-only).
outputTranslator - Translator for the output direction. May be null for no input (i.e. write-only).
Method Detail

dispose

public void dispose()
Description copied from class: AbstractBiDiPipe
Forwarded to the child pipe.

Specified by:
dispose in interface Pipe
Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractBiDiPipe

isDisposed

public boolean isDisposed()
Description copied from interface: Pipe
Test if pipe has been disposed.

Specified by:
isDisposed in interface Pipe

input

public boolean input(Object value)
Description copied from interface: Pipe
Input a value into the pipe tree.

Specified by:
input in interface Pipe
Returns:
True if the operation completed successfully.
See Also:
for more info on handling errors.

output

public boolean output(Object value)
Description copied from interface: Pipe
Output a value from a child into the pipe (the reverse of input ()).

Specified by:
output in interface Pipe
Returns:
True if the operation completed successfully.
See Also:
for more info on handling errors.


Copyright © 2008 Commonwealth of Australia