public enum TailOption extends Enum<TailOption> implements Option, TailOptions
tail command.
For most applications, it may be more convenient to use Tail.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. | |||
-s | --countFromStart | The count argument is relative to the beginning of the file
instead of counting from the end of the file. For instance,
tail -s 10 prints the lines starting from line 10;
tail -s 1 prints the whole file. |
TailOptions.Default| Enum Constant and Description |
|---|
chars
Option
--chars, -c:
The count argument is in units of characters instead of
lines. |
countFromStart
Option
--countFromStart, -s:
The count argument is relative to the beginning of the file
instead of counting from the end of the file. |
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<TailOption> |
asSet()
Returns a new set with
this active option. |
static TailOption |
findByAcronym(char acronym)
Returns the option with the given
acronym, or null if no
such option is found. |
boolean |
isSet(TailOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<TailOption> |
iterator()
Returns an immutable iterator returning o single element:
this
option. |
Class<TailOption> |
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(TailOption option)
Returns true if the
acronym should be used for
the specified option in string representations. |
static TailOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TailOption[] |
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 TailOption 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 TailOption suppressHeaders
--suppressHeaders, -q:
Suppresses printing of headers when multiple files are being
examined.public static final TailOption countFromStart
--countFromStart, -s:
The count argument is relative to the beginning of the file
instead of counting from the end of the file. For instance,
tail -s 10 prints the lines starting from line 10;
tail -s 1 prints the whole file.public static TailOption[] values()
for (TailOption c : TailOption.values()) System.out.println(c);
public static TailOption 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<TailOption> optionType()
OptionSetoptionType in interface OptionSet<TailOption>public static TailOption 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(TailOption option)
OptionSetoption is set and false otherwiseisSet in interface OptionSet<TailOption>option - the option to testoption is set in this OptionSetpublic EnumSet<TailOption> asSet()
this active option.asSet in interface OptionSet<TailOption>public Iterator<TailOption> iterator()
this
option.iterator in interface Iterable<TailOption>iterator in interface OptionSet<TailOption>this active option.public int size()
this optionsize in interface OptionSet<TailOption>public boolean useAcronymFor(TailOption option)
acronym should be used for
the specified option in string representations.
This method returns always true for all options.
useAcronymFor in interface OptionSet<TailOption>option - the option of interestCopyright © 2025. All rights reserved.