public final class UniqFactory extends Object implements Uniq.Interface<UniqCommand>
uniq
command returning
a new command instance from every signature method.Modifier and Type | Field and Description |
---|---|
static UniqFactory |
INSTANCE
The singleton instance of this factory.
|
Modifier and Type | Method and Description |
---|---|
UniqCommand |
uniq()
Reads from the standard input and compares adjacent lines, writing
one copy of each input line to the standard output.
|
UniqCommand |
uniq(File file)
Reads from the specified input
file and compares adjacent
lines, writing one copy of each input line to the standard output. |
UniqCommand |
uniq(String... args)
Reads the file specified by the
"--path" operand (the
default operand) and writes only unique lines to the standard
output. |
UniqCommand |
uniq(String path)
Reads the file specified by its
path and compares adjacent
lines, writing one copy of each input line to the standard output. |
UniqCommand |
uniq(UniqOptions options)
Reads from the standard input and compares adjacent lines, writing
one copy of each input line to the standard output.
|
UniqCommand |
uniq(UniqOptions options,
File file)
Reads from the specified input
file and compares adjacent
lines, writing one copy of each input line to the standard output. |
UniqCommand |
uniq(UniqOptions options,
String path)
Reads the file specified by its
path and compares adjacent
lines, writing one copy of each input line to the standard output. |
public static final UniqFactory INSTANCE
public UniqCommand uniq()
Uniq.Interface
Note that repeated lines in the input are not detected if they are not adjacent (see --global or -g option); sorted input lines always result in unique output lines.
uniq
in interface Uniq.Interface<UniqCommand>
<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic UniqCommand uniq(String... args)
Uniq.Interface
"--path"
operand (the
default operand) and writes only unique lines to the standard
output. The second and succeeding copies of repeated input lines are
not written to the output.
Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--path" operand have to be prefixed with the operand name.
Note that repeated lines in the input are not detected if they are not adjacent unless the --global is specified (sorted input lines always result in unique output lines).
uniq
in interface Uniq.Interface<UniqCommand>
args
- String arguments defining the options and operands for the command.
Options can be specified by acronym (with a leading dash "-") or by
long name (with two leading dashes "--"). Operands other than the
default "--path" operand have to be prefixed with the operand
name.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic UniqCommand uniq(File file)
Uniq.Interface
file
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated lines in the input are not detected if they are not adjacent (see --global or -g option); sorted input lines always result in unique output lines.
uniq
in interface Uniq.Interface<UniqCommand>
file
- The files or directories used as starting point for the listing;
relative paths are not resolved (use the string path argument to
enable relative path resolving based on the current working
directory).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic UniqCommand uniq(String path)
Uniq.Interface
path
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated lines in the input are not detected if they are not adjacent (see --global or -g option); sorted input lines always result in unique output lines.
uniq
in interface Uniq.Interface<UniqCommand>
path
- The files or directories used as starting point for the listing;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic UniqCommand uniq(UniqOptions options)
Uniq.Interface
Note that repeated non-adjacent lines in the input are only detected with the --global or -g option. In other words, unique output lines are guaranteed only if either (a) the --global or -g option is specified, or (b) the input lines are sorted.
uniq
in interface Uniq.Interface<UniqCommand>
options
- The options defining the uniqueness details for the output lines.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic UniqCommand uniq(UniqOptions options, File file)
Uniq.Interface
file
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated non-adjacent lines in the input are only detected with the --global or -g option. In other words, unique output lines are guaranteed only if either (a) the --global or -g option is specified, or (b) the input lines are sorted.
uniq
in interface Uniq.Interface<UniqCommand>
options
- The options defining the uniqueness details for the output lines.file
- The files or directories used as starting point for the listing;
relative paths are not resolved (use the string path argument to
enable relative path resolving based on the current working
directory).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic UniqCommand uniq(UniqOptions options, String path)
Uniq.Interface
path
and compares adjacent
lines, writing one copy of each input line to the standard output.
The second and succeeding copies of repeated adjacent input lines
are not written to the output.
Note that repeated non-adjacent lines in the input are only detected with the --global or -g option. In other words, unique output lines are guaranteed only if either (a) the --global or -g option is specified, or (b) the input lines are sorted.
uniq
in interface Uniq.Interface<UniqCommand>
options
- The options defining the uniqueness details for the output lines.path
- The files or directories used as starting point for the listing;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsCopyright © 2024. All rights reserved.