Class NamedBoolean

java.lang.Object
org.ka2ddo.util.NamedBoolean

public abstract class NamedBoolean extends Object
This class provides an object wrapper around an accessor-controlled property of type boolean.
Author:
Andrew Pavlin, KA2DDO
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create a NamedBoolean object with the specified localized name.
    protected
    NamedBoolean(String name, Enum<?> theEnum)
    Create a NamedBoolean object with the specified localized name.
  • Method Summary

    Modifier and Type
    Method
    Description
    Enum<?>
    Returns the enumeration associated with this NamedBoolean (if any).
    abstract boolean
    Report whether the wrapped property is set or not.
    abstract void
    setSelected(boolean newValue)
    Change the wrapped property's boolean value.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NamedBoolean

      protected NamedBoolean(String name)
      Create a NamedBoolean object with the specified localized name.
      Parameters:
      name - String already-localized name to associate with the modifiable boolean value
    • NamedBoolean

      protected NamedBoolean(String name, Enum<?> theEnum)
      Create a NamedBoolean object with the specified localized name.
      Parameters:
      name - String already-localized name to associate with the modifiable boolean value
      theEnum - Enum value to associate with the boolean
  • Method Details

    • toString

      public String toString()
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • getEnum

      public Enum<?> getEnum()
      Returns the enumeration associated with this NamedBoolean (if any).
      Returns:
      Enum value, or null if no associated Enum
    • isSelected

      public abstract boolean isSelected()
      Report whether the wrapped property is set or not.
      Returns:
      the boolean value of the property
    • setSelected

      public abstract void setSelected(boolean newValue)
      Change the wrapped property's boolean value.
      Parameters:
      newValue - the new boolean value for the property