public final class HeadFactory extends Object implements Head.Interface<HeadCommand>
head
command returning
a new command instance from every signature method.Modifier and Type | Field and Description |
---|---|
static HeadFactory |
INSTANCE
The singleton instance of this factory.
|
Modifier and Type | Method and Description |
---|---|
HeadCommand |
head()
Reads the first 10 lines from the standard input and writes them to
the standard output.
|
HeadCommand |
head(File... files)
Reads the first 10 lines from each of the specified files and writes
them to the standard output.
|
HeadCommand |
head(HeadOptions options,
long count)
Reads the first
count lines or characters from the standard
input and writes them to the standard output. |
HeadCommand |
head(HeadOptions options,
long count,
File... files)
Reads the first
count lines or characters from each of the
specified files and writes them to the standard output. |
HeadCommand |
head(HeadOptions options,
long count,
Input... inputs)
Reads the first
count lines or characters from each of the
specified inputs and writes them to the standard output. |
HeadCommand |
head(HeadOptions options,
long count,
String... paths)
Reads the first
count lines or characters from each of the
specified files and writes them to the standard output. |
HeadCommand |
head(Input... inputs)
Reads the first 10 lines from each of the specified inputs and writes
them to the standard output.
|
HeadCommand |
head(long count)
Reads the first
count lines from the standard input and
writes them to the standard output. |
HeadCommand |
head(long count,
File... files)
Reads the first
count lines from each of the specified files
and writes them to the standard output. |
HeadCommand |
head(long count,
Input... inputs)
Reads the first
count lines from each of the specified inputs
and writes them to the standard output. |
HeadCommand |
head(long count,
String... paths)
Reads the first
count lines from each of the specified files
and writes them to the standard output. |
HeadCommand |
head(String... args)
Reads the first n lines from each of the files specified and writes
them to the standard output.
|
public static final HeadFactory INSTANCE
public HeadCommand head()
Head.Interface
head
in interface Head.Interface<HeadCommand>
<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 HeadCommand head(String... args)
Head.Interface
"==> XXX <=="
where "XXX"
is the name
of the file.
Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--paths" operand have to be prefixed with the operand name.
head
in interface Head.Interface<HeadCommand>
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 "--paths" operand have to be prefixed with the operand
name (e.g. "--count" for a subsequent count operand value).<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 HeadCommand head(long count)
Head.Interface
count
lines from the standard input and
writes them to the standard output.head
in interface Head.Interface<HeadCommand>
count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.<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 HeadCommand head(HeadOptions options, long count)
Head.Interface
count
lines or characters from the standard
input and writes them to the standard output.head
in interface Head.Interface<HeadCommand>
options
- Options for the head command.count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.<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 HeadCommand head(File... files)
Head.Interface
"==> XXX <=="
where "XXX"
is the name
of the file.head
in interface Head.Interface<HeadCommand>
files
- The input files to be filtered; relative paths are not resolved (use
the string paths 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 HeadCommand head(Input... inputs)
Head.Interface
"==> XXX <=="
where "XXX"
is the input's
string representation.head
in interface Head.Interface<HeadCommand>
inputs
- The inputs to be filtered.<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 HeadCommand head(long count, File... files)
Head.Interface
count
lines from each of the specified files
and writes them to the standard output. If more than a single file
is specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.head
in interface Head.Interface<HeadCommand>
count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.files
- The input files to be filtered; relative paths are not resolved (use
the string paths 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 HeadCommand head(long count, String... paths)
Head.Interface
count
lines from each of the specified files
and writes them to the standard output. If more than a single file
is specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.head
in interface Head.Interface<HeadCommand>
count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.paths
- Path names of the input files to be filtered; 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 HeadCommand head(long count, Input... inputs)
Head.Interface
count
lines from each of the specified inputs
and writes them to the standard output. If more than a single input
is specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the input's
string representation.head
in interface Head.Interface<HeadCommand>
count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.inputs
- The inputs to be filtered.<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 HeadCommand head(HeadOptions options, long count, File... files)
Head.Interface
count
lines or characters from each of the
specified files and writes them to the standard output. If more than
a single file is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.head
in interface Head.Interface<HeadCommand>
options
- Options for the head command.count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.files
- The input files to be filtered; relative paths are not resolved (use
the string paths 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 HeadCommand head(HeadOptions options, long count, String... paths)
Head.Interface
count
lines or characters from each of the
specified files and writes them to the standard output. If more than
a single file is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the name
of the file.head
in interface Head.Interface<HeadCommand>
options
- Options for the head command.count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.paths
- Path names of the input files to be filtered; 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 HeadCommand head(HeadOptions options, long count, Input... inputs)
Head.Interface
count
lines or characters from each of the
specified inputs and writes them to the standard output. If more than
a single input is specified and the -q
option is not
specified, each file is preceded by a header consisting of the
string "==> XXX <=="
where "XXX"
is the input's
string representation.head
in interface Head.Interface<HeadCommand>
options
- Options for the head command.count
- The first count
lines of each input file are
copied to standard output, starting from 1 (characters instead of
lines if the -c
option is specified). Must be a non-negative
integer or an exception is thrown. If count
is greater than
the number number of lines (characters) in the input, the
application will not error and send the whole file to the output.inputs
- The inputs to be filtered.<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.