public enum CatOption extends Enum<CatOption> implements Option, CatOptions
cat command.
For most applications, it may be more convenient to use Cat.Options
instead of the option constants defined here.
-b | --numberNonBlankLines | Number the non-blank output lines, starting at 1. | |||
-n | --numberLines | Number the output lines, starting at 1. | |||
-s | --squeezeEmptyLines | Squeeze multiple adjacent empty lines, causing the output to be single spaced. |
CatOptions.Default| Enum Constant and Description |
|---|
numberLines
Option
--numberLines, -n:
Number the output lines, starting at 1. |
numberNonBlankLines
Option
--numberNonBlankLines, -b:
Number the non-blank output lines, starting at 1. |
squeezeEmptyLines
Option
--squeezeEmptyLines, -s:
Squeeze multiple adjacent empty lines, causing the output to be
single spaced. |
CONVERTER, EMPTY| Modifier and Type | Method and Description |
|---|---|
char |
acronym()
Returns a one letter acronym for this option.
|
EnumSet<CatOption> |
asSet()
Returns a new set with
this active option. |
static CatOption |
findByAcronym(char acronym)
Returns the option with the given
acronym, or null if no
such option is found. |
boolean |
isSet(CatOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<CatOption> |
iterator()
Returns an immutable iterator returning o single element:
this
option. |
Class<CatOption> |
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(CatOption option)
Returns true if the
acronym should be used for
the specified option in string representations. |
static CatOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CatOption[] |
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 CatOption numberNonBlankLines
--numberNonBlankLines, -b:
Number the non-blank output lines, starting at 1.public static final CatOption numberLines
--numberLines, -n:
Number the output lines, starting at 1.public static final CatOption squeezeEmptyLines
--squeezeEmptyLines, -s:
Squeeze multiple adjacent empty lines, causing the output to be
single spaced.public static CatOption[] values()
for (CatOption c : CatOption.values()) System.out.println(c);
public static CatOption 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<CatOption> optionType()
OptionSetoptionType in interface OptionSet<CatOption>public static CatOption 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(CatOption option)
OptionSetoption is set and false otherwisepublic Iterator<CatOption> iterator()
this
option.public int size()
this optionpublic boolean useAcronymFor(CatOption option)
acronym should be used for
the specified option in string representations.
This method returns always true for all options.
useAcronymFor in interface OptionSet<CatOption>option - the option of interestCopyright © 2025. All rights reserved.