Index

A B C E G H I M N P R S T 
All Classes and Interfaces|All Packages

A

add(String) - Method in class core.ShellHistory
Adds a command to history and resets the navigation index.

B

builtins - package builtins
Contains all built-in shell command implementations (cd, pwd, echo, exit, type, history, etc.).

C

CdCommand - Class in builtins
Implements the 'cd' (change directory) builtin command.
CdCommand() - Constructor for class builtins.CdCommand
Constructs a new CdCommand instance.
Command - Interface in builtins
Interface for all shell commands (builtins and external).
CommandHandler - Class in core
Central class responsible for parsing user input, handling command execution (builtins and external), managing pipelines, redirection, and maintaining the current working directory.
CommandHandler() - Constructor for class core.CommandHandler
Constructs a CommandHandler, initializing all built-in commands, the command history, and setting the current working directory to the user's directory.
complete(String) - Method in class core.TabCompleter
Returns the completed command or argument based on the current input.
core - package core
Contains the core logic for the shell, including the main entry point, command handler, history, input handling, tab completion, and tokenization.

E

EchoCommand - Class in builtins
Implements the 'echo' builtin command.
EchoCommand() - Constructor for class builtins.EchoCommand
Constructs a new EchoCommand instance.
execute(File, File, boolean) - Method in class core.ExternalCommand
Executes the external command with specified redirection files and append mode.
execute(String[], String, Path) - Method in class builtins.CdCommand
Changes the shell's current directory and returns the new path.
execute(String[], String, Path) - Method in interface builtins.Command
Executes the command and returns the (possibly updated) current directory.
execute(String[], String, Path) - Method in class builtins.EchoCommand
Prints its arguments to standard output.
execute(String[], String, Path) - Method in class builtins.ExitCommand
Exits the shell with the given status code.
execute(String[], String, Path) - Method in class builtins.HistoryCommand
Prints the command history.
execute(String[], String, Path) - Method in class builtins.NoOpCommand
Exits the shell with the given status code.
execute(String[], String, Path) - Method in class builtins.PwdCommand
Prints the current directory.
execute(String[], String, Path) - Method in class builtins.TypeCommand
Prints how each argument would be interpreted if used as a command name.
execute(String[], String, Path) - Method in class core.ExternalCommand
Executes the external command and handles redirection.
ExitCommand - Class in builtins
Implements the 'exit' builtin command.
ExitCommand() - Constructor for class builtins.ExitCommand
Constructs a new ExitCommand instance.
ExternalCommand - Class in core
Represents an external (non-builtin) command to be executed via ProcessBuilder.
ExternalCommand(List<String>, File) - Constructor for class core.ExternalCommand
Constructs an ExternalCommand with arguments and optional redirection files.
ExternalCommand(List<String>, File, File) - Constructor for class core.ExternalCommand
Constructs an ExternalCommand with arguments and optional redirection files for stdout and stderr.

G

getArgs() - Method in class core.ExternalCommand
Returns the arguments for the external command.
getCommand(String[], String, File, File) - Method in class core.CommandHandler
Returns the appropriate Command instance (builtin or external) for the given tokens.
getHistory() - Method in class core.CommandHandler
Returns the history of commands.

H

handleCommand(String, Path) - Method in class core.CommandHandler
Parses and executes a single shell command or pipeline, handling redirection and updating the current directory as needed.
HistoryCommand - Class in builtins
Implements the 'history' builtin command.
HistoryCommand(List<String>) - Constructor for class builtins.HistoryCommand
Constructs a HistoryCommand with the given history list.

I

isAppend - Variable in class core.TokenizerResult
True if the output redirection is in append mode ('>>').
isPipeline - Variable in class core.TokenizerResult
True if the input contains a pipeline ('|').
isRedirect - Variable in class core.TokenizerResult
True if the input contains standard output redirection ('>' or '>>').
isStderrAppend - Variable in class core.TokenizerResult
True if the error redirection is in append mode ('2>>').
isStderrRedirect - Variable in class core.TokenizerResult
True if the input contains standard error redirection ('2>' or '2>>').

M

main(String[]) - Static method in class core.Main
The entry point of the Java POSIX Shell application.
Main - Class in core
Entry point for the Java Shell application.
Main() - Constructor for class core.Main
Constructs a new Main instance.

N

next() - Method in class core.ShellHistory
Returns the next command in history.
NoOpCommand - Class in builtins
Represents a no-operation command (used for error handling or unknown commands).
NoOpCommand() - Constructor for class builtins.NoOpCommand
Constructs a new NoOpCommand instance.

P

pipelineParts - Variable in class core.TokenizerResult
The list of TokenizerResult objects for each part of a pipeline, or null if not a pipeline.
previous() - Method in class core.ShellHistory
Returns the previous command in history.
PwdCommand - Class in builtins
Implements the 'pwd' (print working directory) builtin command.
PwdCommand() - Constructor for class builtins.PwdCommand
Constructs a new PwdCommand instance.

R

redirectTarget - Variable in class core.TokenizerResult
The target file for standard output redirection (e.g., after '>' or '>>'), or null if not present.
resetIndex() - Method in class core.ShellHistory
Resets the navigation index to the most recent command.
run(Path) - Method in class core.ShellInputHandler
Runs the main shell loop, reading user input, handling special keys, and delegating command execution.

S

ShellHistory - Class in core
Manages the command history buffer and navigation (up/down arrows).
ShellHistory() - Constructor for class core.ShellHistory
Constructs a new ShellHistory instance.
ShellInputHandler - Class in core
Handles the main shell loop, user input, prompt display, command history navigation, and tab completion.
ShellInputHandler(CommandHandler, String[], String) - Constructor for class core.ShellInputHandler
Constructs a ShellInputHandler with the given command handler, builtins, and PATH environment.
stderrRedirectTarget - Variable in class core.TokenizerResult
The target file for standard error redirection (e.g., after '2>' or '2>>'), or null if not present.

T

TabCompleter - Class in core
Provides tab completion for built-in and external commands.
TabCompleter(String[], String) - Constructor for class core.TabCompleter
Constructs a TabCompleter with the given builtins and PATH environment.
tokenize(String) - Method in class core.Tokenizer
Tokenizes the input string, splitting into tokens and pipeline parts.
Tokenizer - Class in core
Tokenizes shell input, handling quotes, escapes, and pipeline splitting.
Tokenizer() - Constructor for class core.Tokenizer
Constructs a new Tokenizer instance.
TokenizerResult - Class in core
Holds the result of tokenizing a shell input string, including tokens and pipeline parts.
TokenizerResult(List<String>) - Constructor for class core.TokenizerResult
Constructs a TokenizerResult with the given tokens.
tokens - Variable in class core.TokenizerResult
The list of tokens parsed from the input string.
TypeCommand - Class in builtins
Implements the 'type' builtin command.
TypeCommand() - Constructor for class builtins.TypeCommand
Constructs a new TypeCommand instance.
A B C E G H I M N P R S T 
All Classes and Interfaces|All Packages