Package | Description |
---|---|
org.unix4j.command |
Declares the basic command interface and contains related classes used by
most command implementations.
|
org.unix4j.io |
Contains interfaces and classes used to handle input and output of commands.
|
org.unix4j.operation |
Contains the
LineOperation
interface and the AdHocCommand
implementation facilitating the creation of ad-hoc commands. |
org.unix4j.processor |
Defines
LineProcessor and
InputProcessor , two interfaces
used for line-by-line input processing, and provides some basic
implementations for both interfaces. |
org.unix4j.unix.cat |
Contains private classes used by the
cat command. |
org.unix4j.unix.cd |
Contains private classes used by the
cd command. |
org.unix4j.unix.cut |
Contains private classes used by the
cut command. |
org.unix4j.unix.echo |
Contains private classes used by the
echo command. |
org.unix4j.unix.find |
Contains private classes used by the
find command. |
org.unix4j.unix.from |
Contains private classes used by the
from command. |
org.unix4j.unix.grep |
Contains private classes used by the
grep command. |
org.unix4j.unix.head |
Contains private classes used by the
head command. |
org.unix4j.unix.ls |
Contains private classes used by the
ls command. |
org.unix4j.unix.sed |
Contains private classes used by the
sed command. |
org.unix4j.unix.sort |
Contains private classes used by the
sort command. |
org.unix4j.unix.tail |
Contains private classes used by the
tail command. |
org.unix4j.unix.uniq |
Contains private classes used by the
uniq command. |
org.unix4j.unix.wc |
Contains private classes used by the
wc command. |
org.unix4j.unix.xargs |
Contains private classes used by the
xargs command. |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
NoOp.execute(ExecutionContext context,
LineProcessor output) |
LineProcessor |
Command.execute(ExecutionContext context,
LineProcessor output)
Executes this command and returns a
LineProcessor object. |
LineProcessor |
JoinedCommand.execute(ExecutionContext context,
LineProcessor output)
Executes this joined command redirecting the output of the first command
such that it becomes the input of the second command.
|
Modifier and Type | Method and Description |
---|---|
LineProcessor |
NoOp.execute(ExecutionContext context,
LineProcessor output) |
LineProcessor |
Command.execute(ExecutionContext context,
LineProcessor output)
Executes this command and returns a
LineProcessor object. |
LineProcessor |
JoinedCommand.execute(ExecutionContext context,
LineProcessor output)
Executes this joined command redirecting the output of the first command
such that it becomes the input of the second command.
|
Modifier and Type | Interface and Description |
---|---|
interface |
Output
Represents a line-by-line output device.
|
Modifier and Type | Class and Description |
---|---|
class |
BufferedOutput
Output device storing all written lines in memory in a
List . |
class |
FileOutput
Output device writing to a
File . |
class |
NullOutput
Output device writing to
/dev/null , which means that all lines
written to this device are ignored. |
class |
StdOutput
Output device writing to the
standard output stream. |
class |
StreamOutput
Output device writing to an
OutputStream . |
class |
StringOutput
Output device writing the output lines to a string.
|
class |
WriterOutput
Output device based on a
Writer . |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
AdHocCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
AdHocCommand.execute(ExecutionContext context,
LineProcessor output) |
void |
LineOperation.operate(ExecutionContext context,
Line input,
LineProcessor output)
Performs an operation for the given input line.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractLineProcessor<A extends Arguments<A>>
Abstract base implementation for
LineProcessor returned by the
execute method of commands constructed with a reference to the command plus
context and output passed to
Command.execute(ExecutionContext, LineProcessor) . |
class |
InputLineProcessor
A line processor for a single input
|
class |
MultipleInputLineProcessor
A line processor for multiple inputs processing the same operation for each
input object individually.
|
class |
RedirectInputLineProcessor
A line processor redirects a given
Input stream to the standard input
of a command. |
Modifier and Type | Method and Description |
---|---|
protected LineProcessor |
AbstractLineProcessor.getOutput()
Returns the output that was passed to the constructor of this line
processor, the object to write to when executing the command through the
this processor
|
Modifier and Type | Method and Description |
---|---|
void |
DefaultInputProcessor.begin(Input input,
LineProcessor output) |
void |
InputProcessor.begin(Input input,
LineProcessor output)
Indicates that the line processing task is about to start for the
specified
input device. |
protected void |
MultipleInputLineProcessor.beginMultiple(List<? extends Input> inputs,
LineProcessor output)
Called once at the beginning before iterating over the
Input
objects in the given inputs list. |
void |
DefaultInputProcessor.finish(Input input,
LineProcessor output) |
void |
InputProcessor.finish(Input input,
LineProcessor output)
Indicates that this line processing task is complete for the specified
input device and can finished. |
protected void |
MultipleInputLineProcessor.finishMultiple(List<? extends Input> inputs,
LineProcessor output)
Called once at the end after iterating over the
Input objects in
the given inputs list. |
boolean |
DefaultInputProcessor.processLine(Input input,
Line line,
LineProcessor output) |
boolean |
InputProcessor.processLine(Input input,
Line line,
LineProcessor output)
Processes a single line and returns true if this
InputProcessor
is ready to process more lines. |
Constructor and Description |
---|
AbstractLineProcessor(Command<A> command,
ExecutionContext context,
LineProcessor output)
Constructor with command creating this processor, execution context and
output to write to.
|
InputLineProcessor(Input input,
InputProcessor processor,
LineProcessor output) |
MultipleInputLineProcessor(List<? extends Input> inputs,
InputProcessor processor,
LineProcessor output)
Constructor with input objects (usually file operands of the command) and
the input processor of the command that reads from the standard input.
|
RedirectInputLineProcessor(Input input,
LineProcessor standardInputProcessor)
Constructor with input object (usually a file operand of the command) and
the command processor that reads from the standard input.
|
RedirectInputLineProcessor(List<? extends Input> inputs,
LineProcessor standardInputProcessor)
Constructor with multiple input objects (usually file operands of the
command) and the command processor that reads from the standard input.
|
Modifier and Type | Class and Description |
---|---|
(package private) class |
CatProcessor |
(package private) class |
NumberLinesProcessor |
(package private) class |
SqueezeEmptyLinesProcessor |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
CatCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
CatCommand.execute(ExecutionContext context,
LineProcessor output) |
Constructor and Description |
---|
CatProcessor(Command<CatArguments> command,
ExecutionContext context,
LineProcessor output) |
NumberLinesProcessor(Command<CatArguments> command,
ExecutionContext context,
LineProcessor output) |
SqueezeEmptyLinesProcessor(Command<CatArguments> command,
ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
CdCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
CdCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
CutCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
CutCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
EchoCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
EchoCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
FindCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
FindCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
FromCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
FromCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractGrepProcessor |
(package private) class |
CountMatchingLinesInputProcessor
Counts the matching lines and writes the count and the file name to the
output.
|
(package private) class |
CountMatchingLinesProcessor
Writes the matching line count to the output.
|
(package private) class |
WriteFilesWithMatchingLinesProcessor
Counts the matching lines and writes the count and the file name to the
output.
|
(package private) class |
WriteMatchingLinesProcessor
Writes all matching lines to the output.
|
(package private) class |
WriteMatchingLinesWithLineNumberProcessor
Writes all matching lines to the output.
|
Modifier and Type | Method and Description |
---|---|
LineProcessor |
GrepCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
void |
CountMatchingLinesInputProcessor.begin(Input input,
LineProcessor output) |
void |
WriteMatchingLinesInputProcessor.begin(Input input,
LineProcessor output) |
void |
WriteFilesWithMatchingLinesProcessor.begin(Input input,
LineProcessor output) |
LineProcessor |
GrepCommand.execute(ExecutionContext context,
LineProcessor output) |
void |
CountMatchingLinesInputProcessor.finish(Input input,
LineProcessor output) |
void |
WriteMatchingLinesInputProcessor.finish(Input input,
LineProcessor output) |
void |
WriteFilesWithMatchingLinesProcessor.finish(Input input,
LineProcessor output) |
boolean |
CountMatchingLinesInputProcessor.processLine(Input input,
Line line,
LineProcessor output) |
boolean |
WriteMatchingLinesInputProcessor.processLine(Input input,
Line line,
LineProcessor output) |
boolean |
WriteFilesWithMatchingLinesProcessor.processLine(Input input,
Line line,
LineProcessor output) |
Constructor and Description |
---|
AbstractGrepProcessor(GrepCommand command,
ExecutionContext context,
LineProcessor output,
LineMatcher matcher) |
CountMatchingLinesInputProcessor(GrepCommand command,
ExecutionContext context,
LineProcessor output,
LineMatcher matcher) |
CountMatchingLinesProcessor(GrepCommand command,
ExecutionContext context,
LineProcessor output,
LineMatcher matcher) |
WriteFilesWithMatchingLinesProcessor(GrepCommand command,
ExecutionContext context,
LineProcessor output,
LineMatcher matcher) |
WriteMatchingLinesProcessor(GrepCommand command,
ExecutionContext context,
LineProcessor output,
LineMatcher matcher) |
WriteMatchingLinesWithLineNumberProcessor(GrepCommand command,
ExecutionContext context,
LineProcessor output,
LineMatcher matcher) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractHeadProcessor
Base class for the line processors used by the
HeadCommand . |
(package private) class |
HeadCharsProcessor |
(package private) class |
HeadLinesProcessor |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
HeadCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
HeadCommand.execute(ExecutionContext context,
LineProcessor output) |
Constructor and Description |
---|
AbstractHeadProcessor(HeadCommand command,
ExecutionContext context,
LineProcessor output) |
HeadCharsProcessor(HeadCommand command,
ExecutionContext context,
LineProcessor output) |
HeadLinesProcessor(HeadCommand command,
ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
LsCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
LsCommand.execute(ExecutionContext context,
LineProcessor output) |
boolean |
LsFormatterLong.writeFormatted(File relativeTo,
File file,
LsArguments args,
LineProcessor output) |
boolean |
LsFormatterShort.writeFormatted(File relativeTo,
File file,
LsArguments args,
LineProcessor output) |
boolean |
LsFormatterDirectoryHeader.writeFormatted(File relativeTo,
File file,
LsArguments args,
LineProcessor output) |
boolean |
LsFormatter.writeFormatted(File relativeTo,
File file,
LsArguments args,
LineProcessor output)
Writes information of the given file to the
output . |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractRegexpProcessor |
(package private) class |
AbstractSedProcessor |
(package private) class |
AbstractTextProcessor |
(package private) class |
AppendProcessor |
(package private) class |
ChangeProcessor |
(package private) class |
DeleteProcessor |
(package private) class |
InsertProcessor |
(package private) class |
PrintProcessor |
(package private) class |
SubstituteProcessor |
(package private) class |
TranslateProcessor |
Modifier and Type | Field and Description |
---|---|
protected LineProcessor |
AbstractSedProcessor.output |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
SedCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
abstract AbstractSedProcessor |
Command.createProcessorFor(SedArguments args,
LineProcessor output)
Returns a new instance of the appropriate sed processor for this command.
|
abstract AbstractSedProcessor |
Command.createProcessorFor(String script,
SedArguments args,
LineProcessor output)
Returns a new instance of the appropriate sed processor for this command.
|
LineProcessor |
SedCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractSortProcessor |
(package private) class |
CheckProcessor
Checks whether a file is sorted or not, throws an
ExitValueException
if the file is not sorted. |
(package private) class |
MergeProcessor |
(package private) class |
SortProcessor
Line processor for normal in-memory sort using an
ArrayList to cache
and sort the lines. |
(package private) class |
UniqueSortProcessor |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
SortCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
SortCommand.execute(ExecutionContext context,
LineProcessor output) |
Constructor and Description |
---|
AbstractSortProcessor(SortCommand command,
ExecutionContext context,
LineProcessor output) |
CheckProcessor(SortCommand command,
ExecutionContext context,
LineProcessor output) |
MergeProcessor(SortCommand command,
ExecutionContext context,
LineProcessor output,
List<? extends Input> inputs) |
SortProcessor(SortCommand command,
ExecutionContext context,
LineProcessor output) |
UniqueSortProcessor(SortCommand command,
ExecutionContext context,
LineProcessor output) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractTailProcessor
Base class for the line processors used by the
TailCommand . |
class |
TailCharsFromEndProcessor |
(package private) class |
TailCharsFromStartProcessor |
(package private) class |
TailLinesFromEndProcessor |
(package private) class |
TailLinesFromStartProcessor |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
TailCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
TailCommand.execute(ExecutionContext context,
LineProcessor output) |
Constructor and Description |
---|
AbstractTailProcessor(TailCommand command,
ExecutionContext context,
LineProcessor output) |
TailCharsFromEndProcessor(TailCommand command,
ExecutionContext context,
LineProcessor output) |
TailCharsFromStartProcessor(TailCommand command,
ExecutionContext context,
LineProcessor output) |
TailLinesFromEndProcessor(TailCommand command,
ExecutionContext context,
LineProcessor output) |
TailLinesFromStartProcessor(TailCommand command,
ExecutionContext context,
LineProcessor output) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AdjacentProcessor
Line processors implementing the actual uniq command execution for the case
when the
global option is NOT selected. |
static class |
AdjacentProcessor.Count
Line processor implementing the actual uniq command execution for the
case when only the
count option is selected. |
static class |
AdjacentProcessor.DuplicateOnly
Line processor implementing the actual uniq command execution for the
case when only the
duplicatedOnly
option is selected. |
static class |
AdjacentProcessor.Normal
Line processor implementing the actual uniq command execution for the
case when no option is selected.
|
protected static class |
AdjacentProcessor.UniqueDuplicateCount
Abstract base class for member classes
AdjacentProcessor.UniqueOnly ,
AdjacentProcessor.DuplicateOnly and AdjacentProcessor.Count |
static class |
AdjacentProcessor.UniqueOnly
Line processor implementing the actual uniq command execution for the
case when only the
uniqueOnly option is
selected. |
(package private) class |
GlobalProcessor
Line processors implementing the actual uniq command execution for the case
when the
global option is selected. |
static class |
GlobalProcessor.Count
|
static class |
GlobalProcessor.DuplicateOnly
Line processor implementing the actual uniq command execution for the
case when the
global option is selected along
with the duplicatedOnly option. |
static class |
GlobalProcessor.Normal
Line processor implementing the actual uniq command execution for the
case when only the
global option is selected. |
protected static class |
GlobalProcessor.UniqueDuplicateCount
Abstract base class for member classes
GlobalProcessor.UniqueOnly ,
GlobalProcessor.DuplicateOnly and GlobalProcessor.Count |
static class |
GlobalProcessor.UniqueOnly
Line processor implementing the actual uniq command execution for the
case when the
global option is selected along
with the uniqueOnly option. |
(package private) class |
UniqProcessor |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
UniqCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
UniqCommand.execute(ExecutionContext context,
LineProcessor output) |
protected abstract boolean |
UniqProcessor.processLine(Line line,
LineProcessor output) |
protected boolean |
AdjacentProcessor.Normal.processLine(Line line,
LineProcessor output) |
protected boolean |
AdjacentProcessor.UniqueDuplicateCount.processLine(Line line,
LineProcessor output) |
protected boolean |
GlobalProcessor.Normal.processLine(Line line,
LineProcessor output) |
protected boolean |
GlobalProcessor.UniqueDuplicateCount.processLine(Line line,
LineProcessor output) |
static int |
CountUtil.writeCountLine(Line line,
long count,
int countDigits,
LineProcessor output)
Writes the given line prefixed with the count using the format
' ' + <count> + ' ' + <line> and using CountUtil.formatCount(long, int) to format <count> . |
protected abstract void |
GlobalProcessor.UniqueDuplicateCount.writeLine(Line line,
long count,
int maxCountDigits,
LineProcessor output) |
protected void |
GlobalProcessor.UniqueOnly.writeLine(Line line,
long count,
int maxCountDigits,
LineProcessor output) |
protected void |
GlobalProcessor.DuplicateOnly.writeLine(Line line,
long count,
int maxCountDigits,
LineProcessor output) |
protected void |
GlobalProcessor.Count.writeLine(Line line,
long count,
int maxCountDigits,
LineProcessor output) |
protected abstract void |
AdjacentProcessor.UniqueDuplicateCount.writeLine(Line line,
long count,
LineProcessor output) |
protected void |
AdjacentProcessor.UniqueOnly.writeLine(Line line,
long count,
LineProcessor output) |
protected void |
AdjacentProcessor.DuplicateOnly.writeLine(Line line,
long count,
LineProcessor output) |
protected void |
AdjacentProcessor.Count.writeLine(Line line,
long count,
LineProcessor output) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
WcMultipleFilesProcessor
Input processor for line, word and char count for multiple input files.
|
(package private) class |
WcProcessor
Standard input processor for line, word and char count.
|
Modifier and Type | Method and Description |
---|---|
LineProcessor |
WcCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
WcCommand.execute(ExecutionContext context,
LineProcessor output) |
void |
WcFileProcessor.finish(Input input,
LineProcessor output) |
boolean |
WcFileProcessor.processLine(Input input,
Line line,
LineProcessor output) |
void |
Counters.writeCountsLine(LineProcessor output)
Writes the counts line to the specified
output . |
void |
Counters.writeCountsLineWithFileInfo(LineProcessor output,
String fileInfo)
Writes the counts line to the specified
output appending the
specified file information. |
void |
Counters.writeCountsLineWithFileInfo(LineProcessor output,
String fileInfo,
int fixedWidthOfColumnsInOutput)
Writes the counts line to the specified
output appending the
specified file information. |
Constructor and Description |
---|
WcMultipleFilesProcessor(ExecutionContext context,
List<? extends Input> inputs,
LineProcessor output,
WcArguments args) |
WcProcessor(WcCommand command,
ExecutionContext context,
LineProcessor output) |
Modifier and Type | Class and Description |
---|---|
(package private) class |
XargsLineProcessor |
(package private) class |
XargsOutput
Output object passed to invoked commands.
|
Modifier and Type | Method and Description |
---|---|
LineProcessor |
XargsCommand.execute(ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
XargsCommand.execute(ExecutionContext context,
LineProcessor output) |
Constructor and Description |
---|
XargsLineProcessor(XargsCommand command,
ExecutionContext context,
LineProcessor output) |
XargsOutput(LineProcessor delegate) |
Copyright © 2024. All rights reserved.