public enum CutOption extends Enum<CutOption> implements Option, CutOptions
cut
command.
For most applications, it may be more convenient to use Cut.Options
instead of the option constants defined here.
-c | --chars | The list specifies character positions. | |||
-f | --fields | The list specifies fields, separated in the input by the field delimiter character (see the -d option.) Output fields are separated by a single occurrence of the field delimiter character. |
CutOptions.Default
Enum Constant and Description |
---|
chars
Option
--chars , -c :
The list specifies character positions. |
fields
Option
--fields , -f :
The list specifies fields, separated in the input by the field
delimiter character (see the -d option.) Output fields are
separated by a single occurrence of the field delimiter character. |
CONVERTER, EMPTY
Modifier and Type | Method and Description |
---|---|
char |
acronym()
Returns a one letter acronym for this option.
|
EnumSet<CutOption> |
asSet()
Returns a new set with
this active option. |
static CutOption |
findByAcronym(char acronym)
Returns the option with the given
acronym , or null if no
such option is found. |
boolean |
isSet(CutOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<CutOption> |
iterator()
Returns an immutable iterator returning o single element:
this
option. |
Class<CutOption> |
optionType()
Returns the option type class, usually an enum.
|
int |
size()
Returns 1 as this is a set with a single element:
this option |
boolean |
useAcronymFor(CutOption option)
Returns true if the
acronym should be used for
the specified option in string representations. |
static CutOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CutOption[] |
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 CutOption chars
--chars
, -c
:
The list specifies character positions.public static CutOption[] values()
for (CutOption c : CutOption.values()) System.out.println(c);
public static CutOption 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<CutOption> optionType()
OptionSet
optionType
in interface OptionSet<CutOption>
public static CutOption findByAcronym(char acronym)
acronym
, or null
if no
such option is found.acronym
- the option acronym
acronym
or null
if it
is not foundpublic char acronym()
Option
public boolean isSet(CutOption option)
OptionSet
option
is set and false otherwisepublic Iterator<CutOption> iterator()
this
option.public int size()
this
optionpublic boolean useAcronymFor(CutOption option)
acronym
should be used for
the specified option
in string representations.
This method returns always true for all options.
useAcronymFor
in interface OptionSet<CutOption>
option
- the option of interestCopyright © 2024. All rights reserved.