enum CounterType extends Enum<CounterType>
Modifier and Type | Method and Description |
---|---|
abstract int |
count(Line line)
Returns the count by which a counter should be incremented given the
specified
line . |
abstract boolean |
isOptionSet(WcArguments args)
Returns true if the option relevant for this count type is set in
args . |
static CounterType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CounterType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CounterType Lines
public static final CounterType Words
public static final CounterType Chars
public static CounterType[] values()
for (CounterType c : CounterType.values()) System.out.println(c);
public static CounterType 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 abstract boolean isOptionSet(WcArguments args)
args
.args
- the arguments with the count optionspublic abstract int count(Line line)
line
. For instance, the method returns 1 if this type
specifies that lines are counted, and it returns the number of words or
characters in the line if the count type refers to words or chars,
respectively.line
- the line to analyseCopyright © 2024. All rights reserved.