public enum EchoOptionSet_n extends Enum<EchoOptionSet_n> implements EchoOptions
echo
command with
the following options: n
.
Application code does normally not directly refer to this class;
Echo.Options
should be used instead to specify command
options. See also EchoOptions
for more information.
EchoOptions.Default
Enum Constant and Description |
---|
Active_n
Option set with the following active options:
n . |
Active_n_long
Option set with the following active options:
n . |
Modifier and Type | Field and Description |
---|---|
EchoOptionSet_n |
n
Option
"-n" : Do not print the trailing newline character(s). |
EchoOptionSet_n |
noNewline
Option
"--noNewline" : Do not print the trailing newline character(s). |
CONVERTER, EMPTY
Modifier and Type | Method and Description |
---|---|
EnumSet<EchoOption> |
asSet()
Returns the set with the active options.
|
boolean |
isSet(EchoOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<EchoOption> |
iterator()
Returns an immutable iterator with the active options of this option set.
|
Class<EchoOption> |
optionType()
Returns the option type class, usually an enum.
|
int |
size()
Returns the number of active options in this option set.
|
boolean |
useAcronymFor(EchoOption option)
Returns true if the
acronym should be used in
for the specified option string representations. |
static EchoOptionSet_n |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EchoOptionSet_n[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
forEach, spliterator
public static final EchoOptionSet_n Active_n
n
.public static final EchoOptionSet_n Active_n_long
n
.public final EchoOptionSet_n n
"-n"
: Do not print the trailing newline character(s).
The option "-n"
is equivalent to the "--
noNewline
"
option.
Technically speaking, this field points to a set with the options of the
current set plus the option "-n"
. If the option "-n"
is already set, the field n
points to the enum constant itself
as it already represents the current set of options.
public final EchoOptionSet_n noNewline
"--noNewline"
: Do not print the trailing newline character(s).
The option "--noNewline"
is equivalent to the "-
n
"
option.
Technically speaking, this field points to a set with the options of the
current set plus the option "--noNewline"
. If the option "--noNewline"
is already set, the field noNewline
points to the enum constant itself
as it already represents the current set of options.
public static EchoOptionSet_n[] values()
for (EchoOptionSet_n c : EchoOptionSet_n.values()) System.out.println(c);
public static EchoOptionSet_n valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Class<EchoOption> optionType()
OptionSet
optionType
in interface OptionSet<EchoOption>
public boolean isSet(EchoOption option)
OptionSet
option
is set and false otherwiseisSet
in interface OptionSet<EchoOption>
option
- the option to testoption
is set in this OptionSet
public int size()
OptionSet
size
in interface OptionSet<EchoOption>
public EnumSet<EchoOption> asSet()
this
option set.asSet
in interface OptionSet<EchoOption>
public Iterator<EchoOption> iterator()
iterator
in interface Iterable<EchoOption>
iterator
in interface OptionSet<EchoOption>
public boolean useAcronymFor(EchoOption option)
acronym
should be used in
for the specified option
string representations.
In particular and independent from the option
argument, this
option set returns true if the last option added to this set was an
acronym, and false if it was a long option name.
For instance, the set defined as
EchoOptionSet_n.n;uses acronyms, that is, this method always returns true for the above set.
On the other hand, long option names are used and this method always returns false for the set
EchoOptionSet_n.noNewline;
Note that a repeated option is not treated as the last set option. For instance, the first and last option of the following set are equivalent and acronyms are used:
EchoOptionSet_n.n.noNewline;
This method always returns true for the empty set with no active options.
useAcronymFor
in interface OptionSet<EchoOption>
option
- the option of interest, has no impact on the result returned
by this methodCopyright © 2024. All rights reserved.