Interface ModeSetting<A>

Type Parameters:
A - format of data used by the ModeManager this ModeSetting is associated with
All Known Implementing Classes:
MaximizedModeSetting

public interface ModeSetting<A>
A set of properties that belong to some Mode but are stored independent from that mode. Each of the read/write methods gets access to the ModeSettingsConverter that is used by the ModeSettings to store data in memory. The methods are not required to use the converter, but the implementation may be easier when using the converters read/write methods as well.
Author:
Benjamin Sigg
  • Method Details

    • getModeId

      Path getModeId()
      Gets the unique identifier of the Mode this setting is associated with.
      Returns:
      the identifier
    • write

      <B> void write(DataOutputStream out, ModeSettingsConverter<A,B> converter) throws IOException
      Writes the contents of this setting into out.
      Parameters:
      out - the stream to write into
      converter - converts data to and from persistent storage
      Throws:
      IOException - in case of an error
    • read

      <B> void read(DataInputStream in, ModeSettingsConverter<A,B> converter) throws IOException
      Reads the contents of this setting from in.
      Parameters:
      in - the stream to read from
      converter - converts data to and from persistent storage
      Throws:
      IOException - in case of an error
    • write

      <B> void write(XElement element, ModeSettingsConverter<A,B> converter)
      Writes the contents of this setting into element. This method should add children to element, but not change the attributes of element.
      Parameters:
      element - the item to write into
      converter - converts data to and from persistent storage
    • read

      <B> void read(XElement element, ModeSettingsConverter<A,B> converter)
      Reads the contents of this setting from element.
      Parameters:
      element - the item to read from
      converter - converts data to and from persistent storage