A
- the type of properties outsideB
- the type of properties that represent the outside propertiespublic interface ModeSettingsConverter<A,B>
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).Modifier and Type | Method and Description |
---|---|
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.
|
A convertToWorld(B b)
b
- a property from outsideB convertToSetting(A a)
a
- the property from insidevoid writeProperty(B b, DataOutputStream out) throws IOException
b
- the property to writeout
- the stream to write intoIOException
- if an I/O-error occursB readProperty(DataInputStream in) throws IOException
in
- the stream to read fromIOException
- if an I/O-error occursvoid writePropertyXML(B b, XElement element)
b
- the property to writeelement
- the element to write into, the attributes of the
element must not be changed