public enum HeadOption extends Enum<HeadOption> implements Option, HeadOptions
head command.
For most applications, it may be more convenient to use Head.Options
instead of the option constants defined here.
-c | --chars | The count argument is in units of characters instead of
lines. Starts from 1 and includes line ending characters. | |||
-q | --suppressHeaders | Suppresses printing of headers when multiple files are being examined. |
HeadOptions.Default| Enum Constant and Description |
|---|
chars
Option
--chars, -c:
The count argument is in units of characters instead of
lines. |
suppressHeaders
Option
--suppressHeaders, -q:
Suppresses printing of headers when multiple files are being
examined. |
CONVERTER, EMPTY| Modifier and Type | Method and Description |
|---|---|
char |
acronym()
Returns a one letter acronym for this option.
|
EnumSet<HeadOption> |
asSet()
Returns a new set with
this active option. |
static HeadOption |
findByAcronym(char acronym)
Returns the option with the given
acronym, or null if no
such option is found. |
boolean |
isSet(HeadOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<HeadOption> |
iterator()
Returns an immutable iterator returning o single element:
this
option. |
Class<HeadOption> |
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(HeadOption option)
Returns true if the
acronym should be used for
the specified option in string representations. |
static HeadOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HeadOption[] |
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, valueOfforEach, spliteratorpublic static final HeadOption chars
--chars, -c:
The count argument is in units of characters instead of
lines. Starts from 1 and includes line ending characters.public static final HeadOption suppressHeaders
--suppressHeaders, -q:
Suppresses printing of headers when multiple files are being
examined.public static HeadOption[] values()
for (HeadOption c : HeadOption.values()) System.out.println(c);
public static HeadOption 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<HeadOption> optionType()
OptionSetoptionType in interface OptionSet<HeadOption>public static HeadOption findByAcronym(char acronym)
acronym, or null if no
such option is found.acronym - the option acronymacronym or null if it
is not foundpublic char acronym()
Optionpublic boolean isSet(HeadOption option)
OptionSetoption is set and false otherwiseisSet in interface OptionSet<HeadOption>option - the option to testoption is set in this OptionSetpublic EnumSet<HeadOption> asSet()
this active option.asSet in interface OptionSet<HeadOption>public Iterator<HeadOption> iterator()
this
option.iterator in interface Iterable<HeadOption>iterator in interface OptionSet<HeadOption>this active option.public int size()
this optionsize in interface OptionSet<HeadOption>public boolean useAcronymFor(HeadOption option)
acronym should be used for
the specified option in string representations.
This method returns always true for all options.
useAcronymFor in interface OptionSet<HeadOption>option - the option of interestCopyright © 2025. All rights reserved.