Package org.aesh.terminal
Class Attributes
java.lang.Object
org.aesh.terminal.Attributes
Terminal attributes representing the terminal state including control characters,
input flags, output flags, control flags, and local flags.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumControl characters for terminal I/O processing.static enumControl flags for hardware control of terminal.static enumInput flags for software input processing.static enumLocal flags for terminal behavior.static enumOutput flags for software output processing. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Attributes instance with default values.Attributes(Attributes attr) Creates a new Attributes instance by copying from another. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(Attributes attributes) Copies all attributes from another Attributes instance.intReturns the value of a specific control character.Returns the map of control characters.booleanChecks if a specific control flag is set.Returns the set of control flags.booleanChecks if a specific input flag is set.Returns the set of input flags.booleanChecks if a specific local flag is set.Returns the set of local flags.booleanChecks if a specific output flag is set.Returns the set of output flags.voidsetControlChar(Attributes.ControlChar c, int value) Sets the value of a control character.voidSets the control characters, replacing any existing mappings.voidsetControlFlag(Attributes.ControlFlag flag, boolean value) Adds or removes a single control flag.voidSets the control flags, replacing any existing flags.voidsetControlFlags(EnumSet<Attributes.ControlFlag> flags, boolean value) Adds or removes multiple control flags.voidsetInputFlag(Attributes.InputFlag flag, boolean value) Adds or removes a single input flag.voidsetInputFlags(EnumSet<Attributes.InputFlag> flags) Sets the input flags, replacing any existing flags.voidsetInputFlags(EnumSet<Attributes.InputFlag> flags, boolean value) Adds or removes multiple input flags.voidsetLocalFlag(Attributes.LocalFlag flag, boolean value) Adds or removes a single local flag.voidsetLocalFlags(EnumSet<Attributes.LocalFlag> flags) Sets the local flags, replacing any existing flags.voidsetLocalFlags(EnumSet<Attributes.LocalFlag> flags, boolean value) Adds or removes multiple local flags.voidsetOutputFlag(Attributes.OutputFlag flag, boolean value) Adds or removes a single output flag.voidSets the output flags, replacing any existing flags.voidsetOutputFlags(EnumSet<Attributes.OutputFlag> flags, boolean value) Adds or removes multiple output flags.
-
Constructor Details
-
Attributes
public Attributes()Creates a new Attributes instance with default values. -
Attributes
Creates a new Attributes instance by copying from another.- Parameters:
attr- the attributes to copy from
-
-
Method Details
-
getInputFlags
Returns the set of input flags.- Returns:
- the input flags
-
setInputFlags
Sets the input flags, replacing any existing flags.- Parameters:
flags- the input flags to set
-
getInputFlag
Checks if a specific input flag is set.- Parameters:
flag- the flag to check- Returns:
- true if the flag is set
-
setInputFlags
Adds or removes multiple input flags.- Parameters:
flags- the flags to add or removevalue- true to add, false to remove
-
setInputFlag
Adds or removes a single input flag.- Parameters:
flag- the flag to add or removevalue- true to add, false to remove
-
getOutputFlags
Returns the set of output flags.- Returns:
- the output flags
-
setOutputFlags
Sets the output flags, replacing any existing flags.- Parameters:
flags- the output flags to set
-
getOutputFlag
Checks if a specific output flag is set.- Parameters:
flag- the flag to check- Returns:
- true if the flag is set
-
setOutputFlags
Adds or removes multiple output flags.- Parameters:
flags- the flags to add or removevalue- true to add, false to remove
-
setOutputFlag
Adds or removes a single output flag.- Parameters:
flag- the flag to add or removevalue- true to add, false to remove
-
getControlFlags
Returns the set of control flags.- Returns:
- the control flags
-
setControlFlags
Sets the control flags, replacing any existing flags.- Parameters:
flags- the control flags to set
-
getControlFlag
Checks if a specific control flag is set.- Parameters:
flag- the flag to check- Returns:
- true if the flag is set
-
setControlFlags
Adds or removes multiple control flags.- Parameters:
flags- the flags to add or removevalue- true to add, false to remove
-
setControlFlag
Adds or removes a single control flag.- Parameters:
flag- the flag to add or removevalue- true to add, false to remove
-
getLocalFlags
Returns the set of local flags.- Returns:
- the local flags
-
setLocalFlags
Sets the local flags, replacing any existing flags.- Parameters:
flags- the local flags to set
-
getLocalFlag
Checks if a specific local flag is set.- Parameters:
flag- the flag to check- Returns:
- true if the flag is set
-
setLocalFlags
Adds or removes multiple local flags.- Parameters:
flags- the flags to add or removevalue- true to add, false to remove
-
setLocalFlag
Adds or removes a single local flag.- Parameters:
flag- the flag to add or removevalue- true to add, false to remove
-
getControlChars
Returns the map of control characters.- Returns:
- the control characters map
-
setControlChars
Sets the control characters, replacing any existing mappings.- Parameters:
chars- the control characters map to set
-
getControlChar
Returns the value of a specific control character.- Parameters:
c- the control character- Returns:
- the character value, or -1 if not set
-
setControlChar
Sets the value of a control character.- Parameters:
c- the control charactervalue- the character value
-
copy
Copies all attributes from another Attributes instance.- Parameters:
attributes- the attributes to copy from
-