public enum UniqOptionSet_cg extends Enum<UniqOptionSet_cg> implements UniqOptions
uniq
command with
the following options: c
, g
.
Application code does normally not directly refer to this class;
Uniq.Options
should be used instead to specify command
options. See also UniqOptions
for more information.
UniqOptions.Default
Enum Constant and Description |
---|
Active_c
Option set with the following active options:
c . |
Active_c_long
Option set with the following active options:
c . |
Active_cg
|
Active_cg_long
|
Modifier and Type | Field and Description |
---|---|
UniqOptionSet_cg |
c
Option
"-c" : Precedes each output line with a count of the number of times the
line occurred in the input. |
UniqOptionSet_cg |
count
Option
"--count" : Precedes each output line with a count of the number of times the
line occurred in the input. |
UniqOptionSet_cg |
g
Option
"-g" : Suppresses repeated lines globally, that is, if lines are
non-adjacent. |
UniqOptionSet_cg |
global
Option
"--global" : Suppresses repeated lines globally, that is, if lines are
non-adjacent. |
CONVERTER, EMPTY
Modifier and Type | Method and Description |
---|---|
EnumSet<UniqOption> |
asSet()
Returns the set with the active options.
|
boolean |
isSet(UniqOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<UniqOption> |
iterator()
Returns an immutable iterator with the active options of this option set.
|
Class<UniqOption> |
optionType()
Returns the option type class, usually an enum.
|
int |
size()
Returns the number of active options in this option set.
|
boolean |
useAcronymFor(UniqOption option)
Returns true if the
acronym should be used in
for the specified option string representations. |
static UniqOptionSet_cg |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static UniqOptionSet_cg[] |
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 UniqOptionSet_cg Active_cg
public static final UniqOptionSet_cg Active_cg_long
public static final UniqOptionSet_cg Active_c
c
.public static final UniqOptionSet_cg Active_c_long
c
.public final UniqOptionSet_cg c
"-c"
: Precedes each output line with a count of the number of times the
line occurred in the input.
The option "-c"
is equivalent to the "--
count
"
option.
Technically speaking, this field points to a set with the options of the
current set plus the option "-c"
. If the option "-c"
is already set, the field c
points to the enum constant itself
as it already represents the current set of options.
public final UniqOptionSet_cg count
"--count"
: Precedes each output line with a count of the number of times the
line occurred in the input.
The option "--count"
is equivalent to the "-
c
"
option.
Technically speaking, this field points to a set with the options of the
current set plus the option "--count"
. If the option "--count"
is already set, the field count
points to the enum constant itself
as it already represents the current set of options.
public final UniqOptionSet_cg g
"-g"
: Suppresses repeated lines globally, that is, if lines are
non-adjacent. This option guarantees unique output lines even if the
input lines are not sorted.
The option "-g"
is equivalent to the "--
global
"
option.
Technically speaking, this field points to a set with the options of the
current set plus the option "-g"
. If the option "-g"
is already set, the field g
points to the enum constant itself
as it already represents the current set of options.
public final UniqOptionSet_cg global
"--global"
: Suppresses repeated lines globally, that is, if lines are
non-adjacent. This option guarantees unique output lines even if the
input lines are not sorted.
The option "--global"
is equivalent to the "-
g
"
option.
Technically speaking, this field points to a set with the options of the
current set plus the option "--global"
. If the option "--global"
is already set, the field global
points to the enum constant itself
as it already represents the current set of options.
public static UniqOptionSet_cg[] values()
for (UniqOptionSet_cg c : UniqOptionSet_cg.values()) System.out.println(c);
public static UniqOptionSet_cg 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<UniqOption> optionType()
OptionSet
optionType
in interface OptionSet<UniqOption>
public boolean isSet(UniqOption option)
OptionSet
option
is set and false otherwiseisSet
in interface OptionSet<UniqOption>
option
- the option to testoption
is set in this OptionSet
public int size()
OptionSet
size
in interface OptionSet<UniqOption>
public EnumSet<UniqOption> asSet()
this
option set.asSet
in interface OptionSet<UniqOption>
public Iterator<UniqOption> iterator()
iterator
in interface Iterable<UniqOption>
iterator
in interface OptionSet<UniqOption>
public boolean useAcronymFor(UniqOption 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
UniqOptionSet_cg.count.g;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
UniqOptionSet_cg.c.global;
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:
UniqOptionSet_cg.c.g.count;
This method always returns true for the empty set with no active options.
useAcronymFor
in interface OptionSet<UniqOption>
option
- the option of interest, has no impact on the result returned
by this methodCopyright © 2024. All rights reserved.