Class Attributes

java.lang.Object
org.aesh.terminal.Attributes

public class Attributes extends Object
Terminal attributes representing the terminal state including control characters, input flags, output flags, control flags, and local flags.
  • Constructor Details

    • Attributes

      public Attributes()
      Creates a new Attributes instance with default values.
    • Attributes

      public Attributes(Attributes attr)
      Creates a new Attributes instance by copying from another.
      Parameters:
      attr - the attributes to copy from
  • Method Details

    • getInputFlags

      public EnumSet<Attributes.InputFlag> getInputFlags()
      Returns the set of input flags.
      Returns:
      the input flags
    • setInputFlags

      public void setInputFlags(EnumSet<Attributes.InputFlag> flags)
      Sets the input flags, replacing any existing flags.
      Parameters:
      flags - the input flags to set
    • getInputFlag

      public boolean getInputFlag(Attributes.InputFlag flag)
      Checks if a specific input flag is set.
      Parameters:
      flag - the flag to check
      Returns:
      true if the flag is set
    • setInputFlags

      public void setInputFlags(EnumSet<Attributes.InputFlag> flags, boolean value)
      Adds or removes multiple input flags.
      Parameters:
      flags - the flags to add or remove
      value - true to add, false to remove
    • setInputFlag

      public void setInputFlag(Attributes.InputFlag flag, boolean value)
      Adds or removes a single input flag.
      Parameters:
      flag - the flag to add or remove
      value - true to add, false to remove
    • getOutputFlags

      public EnumSet<Attributes.OutputFlag> getOutputFlags()
      Returns the set of output flags.
      Returns:
      the output flags
    • setOutputFlags

      public void setOutputFlags(EnumSet<Attributes.OutputFlag> flags)
      Sets the output flags, replacing any existing flags.
      Parameters:
      flags - the output flags to set
    • getOutputFlag

      public boolean getOutputFlag(Attributes.OutputFlag flag)
      Checks if a specific output flag is set.
      Parameters:
      flag - the flag to check
      Returns:
      true if the flag is set
    • setOutputFlags

      public void setOutputFlags(EnumSet<Attributes.OutputFlag> flags, boolean value)
      Adds or removes multiple output flags.
      Parameters:
      flags - the flags to add or remove
      value - true to add, false to remove
    • setOutputFlag

      public void setOutputFlag(Attributes.OutputFlag flag, boolean value)
      Adds or removes a single output flag.
      Parameters:
      flag - the flag to add or remove
      value - true to add, false to remove
    • getControlFlags

      public EnumSet<Attributes.ControlFlag> getControlFlags()
      Returns the set of control flags.
      Returns:
      the control flags
    • setControlFlags

      public void setControlFlags(EnumSet<Attributes.ControlFlag> flags)
      Sets the control flags, replacing any existing flags.
      Parameters:
      flags - the control flags to set
    • getControlFlag

      public boolean getControlFlag(Attributes.ControlFlag flag)
      Checks if a specific control flag is set.
      Parameters:
      flag - the flag to check
      Returns:
      true if the flag is set
    • setControlFlags

      public void setControlFlags(EnumSet<Attributes.ControlFlag> flags, boolean value)
      Adds or removes multiple control flags.
      Parameters:
      flags - the flags to add or remove
      value - true to add, false to remove
    • setControlFlag

      public void setControlFlag(Attributes.ControlFlag flag, boolean value)
      Adds or removes a single control flag.
      Parameters:
      flag - the flag to add or remove
      value - true to add, false to remove
    • getLocalFlags

      public EnumSet<Attributes.LocalFlag> getLocalFlags()
      Returns the set of local flags.
      Returns:
      the local flags
    • setLocalFlags

      public void setLocalFlags(EnumSet<Attributes.LocalFlag> flags)
      Sets the local flags, replacing any existing flags.
      Parameters:
      flags - the local flags to set
    • getLocalFlag

      public boolean getLocalFlag(Attributes.LocalFlag flag)
      Checks if a specific local flag is set.
      Parameters:
      flag - the flag to check
      Returns:
      true if the flag is set
    • setLocalFlags

      public void setLocalFlags(EnumSet<Attributes.LocalFlag> flags, boolean value)
      Adds or removes multiple local flags.
      Parameters:
      flags - the flags to add or remove
      value - true to add, false to remove
    • setLocalFlag

      public void setLocalFlag(Attributes.LocalFlag flag, boolean value)
      Adds or removes a single local flag.
      Parameters:
      flag - the flag to add or remove
      value - true to add, false to remove
    • getControlChars

      public EnumMap<Attributes.ControlChar,Integer> getControlChars()
      Returns the map of control characters.
      Returns:
      the control characters map
    • setControlChars

      public void setControlChars(EnumMap<Attributes.ControlChar,Integer> chars)
      Sets the control characters, replacing any existing mappings.
      Parameters:
      chars - the control characters map to set
    • getControlChar

      public int getControlChar(Attributes.ControlChar c)
      Returns the value of a specific control character.
      Parameters:
      c - the control character
      Returns:
      the character value, or -1 if not set
    • setControlChar

      public void setControlChar(Attributes.ControlChar c, int value)
      Sets the value of a control character.
      Parameters:
      c - the control character
      value - the character value
    • copy

      public void copy(Attributes attributes)
      Copies all attributes from another Attributes instance.
      Parameters:
      attributes - the attributes to copy from