bibliothek.gui.dock.support.action
Interface ModeTransitionConverter<A,B>

Type Parameters:
A - the type of properties outside
B - the type of properties that represent the outside properties
All Known Implementing Classes:
StateManager.LocationConverter

public interface ModeTransitionConverter<A,B>

A converter converts properties from the outside to the inner world.

Author:
Benjamin Sigg

Method Summary
 B convertToSetting(A a)
          Converts a property from the inside world into the world outside.
 A convertToWorld(B b)
          Converts a property from the outside world into the world of this setting.
 B readProperty(DataInputStream in)
          Reads a single property.
 B readPropertyXML(XElement element)
          Reads a single property.
 void writeProperty(B b, DataOutputStream out)
          Writes a single property of this setting.
 void writePropertyXML(B b, XElement element)
          Writes a single property as xml element.
 

Method Detail

convertToWorld

A convertToWorld(B b)
Converts a property from the outside world into the world of this setting.

Parameters:
b - a property from outside
Returns:
a property from inside

convertToSetting

B convertToSetting(A a)
Converts a property from the inside world into the world outside.

Parameters:
a - the property from inside
Returns:
a property from outside

writeProperty

void writeProperty(B b,
                   DataOutputStream out)
                   throws IOException
Writes a single property of this setting.

Parameters:
b - the property to write
out - the stream to write into
Throws:
IOException - if an I/O-error occurs

readProperty

B readProperty(DataInputStream in)
               throws IOException
Reads a single property.

Parameters:
in - the stream to read from
Returns:
the property that has been read.
Throws:
IOException - if an I/O-error occurs

writePropertyXML

void writePropertyXML(B b,
                      XElement element)
Writes a single property as xml element.

Parameters:
b - the property to write
element - the element to write into, the attributes of the element must not be changed

readPropertyXML

B readPropertyXML(XElement element)
Reads a single property.

Parameters:
element - the element to read the property from
Returns:
the new property