Package bibliothek.gui.dock.support.mode
Interface ModeSettingsConverter<A,B>
- Type Parameters:
A- the type of properties outsideB- the type of properties that represent the outside properties
- All Known Implementing Classes:
LocationSettingConverter
public interface ModeSettingsConverter<A,B>
A converter converts properties from the outside to the inner world. It is used by the
ModeSettings
to store data in memory, a converter should ensure that the data does not reference any object from the
application (such that garbage collection works).- Author:
- Benjamin Sigg
-
Method Summary
Modifier and TypeMethodDescriptionConverts a property from the inside world into the world outside.convertToWorld(B b) Converts a property from the outside world into the world of this setting.Reads a single property.readPropertyXML(XElement element) Reads a single property.voidwriteProperty(B b, DataOutputStream out) Writes a single property of this setting.voidwritePropertyXML(B b, XElement element) Writes a single property as xml element.
-
Method Details
-
convertToWorld
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
Converts a property from the inside world into the world outside.- Parameters:
a- the property from inside- Returns:
- a property from outside
-
writeProperty
Writes a single property of this setting.- Parameters:
b- the property to writeout- the stream to write into- Throws:
IOException- if an I/O-error occurs
-
readProperty
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
Writes a single property as xml element.- Parameters:
b- the property to writeelement- the element to write into, the attributes of the element must not be changed
-
readPropertyXML
Reads a single property.- Parameters:
element- the element to read the property from- Returns:
- the new property
-