A C D E F G H J L M N P R S T U W

A

addResult() - Method in class FileInfo
Returns error message if file does not exist.

C

Cat - class Cat.
The Cat class (a subclass of the abstract base class Command) implements the familiar unix command cat, which outputs each of its file arguments in sequence.
Cat() - Constructor for class Cat
 
Cd - class Cd.
The Cd class (a subclass of the abstract base class Command) implements the familiar unix command cd, which changes the working directory to the specified directory.
Cd() - Constructor for class Cd
 
Command - class Command.
The Command class serves as the abstract base class for each of the commands.
Command() - Constructor for class Command
 

D

Date - class Date.
The Date class (a subclass of the abstract base class Command) implements the familiar unix command date, which outputs the current date and time.
Date() - Constructor for class Date
 
Dirs - class Dirs.
The Dirs class (a subclass of the abstract base class Command) implements the familiar unix command dirs, which outputs the current working directory and then the contents of the directory stack.
Dirs() - Constructor for class Dirs
 
doCount(String) - Method in class Wc
A helper function that counts the number of lines, words, and characters in the current file.

E

Echo - class Echo.
The Echo class (a subclass of the abstract base class Command) implements the familiar unix command echo, which outputs its arguments separated by blanks and terminated by a newline.
Echo() - Constructor for class Echo
 
execute(String) - Method in class Cat
Executes the cat command and returns the result in the form of a String object.
execute(String) - Method in class Cd
Executes the cd command and returns the result in the form of a String object.
execute(String) - Method in class Command
Executes the current command and returns the result in the form of a String object.
execute(String) - Method in class Date
Returns a String representation of the current date and time.
execute(String) - Method in class Dirs
Executes the dirs command and returns the result in the form of a String object.
execute(String) - Method in class Echo
Executes the echo command and returns the result in the form of a String object.
execute(String) - Method in class Head
Executes the head command and returns the result in the form of a String object.
execute(String) - Method in class Ls
Executes the ls command and returns the result in the form of a String object.
execute(String) - Method in class Popd
Executes the popd command and returns the result in the form of a String object.
execute(String) - Method in class Printenv
Executes the printenv command and returns the result in the form of a String object.
execute(String) - Method in class Pushd
Executes the pushd command and returns the result in the form of a String object.
execute(String) - Method in class Pwd
Executes the pwd command and returns the result in the form of a String object.
execute(String) - Method in class Setenv
Executes the setenv command and returns the result in the form of a String object.
execute(String) - Method in class Sort
Executes the sort command and returns the result in the form of a String object.
execute(String) - Method in class Tail
Executes the tail command and returns the result in the form of a String object.
execute(String) - Method in class Unsetenv
Executes the unsetenv command and returns the result in the form of a String object.
execute(String) - Method in class Wc
Executes the wc command and returns the result in the form of a String object.
ExpandArgs(String) - Method in class Command
Expands the arguments of a command to include variables (if any) specified by the character '$' and returns the resulting expanded argument.

F

FileInfo - class FileInfo.
The FileInfo class serves to evaluate file and directory information.
fileList - Variable in class Head
A vector containing string arguments to head - i.e. filenames.
fileList - Variable in class Tail
A vector containing string arguments to tail - i.e. filenames.
fileToString(String) - Method in class Cat
A helper function that converts the given file to a String object.
fileToString(String) - Method in class Head
A helper function that converts the given file to a String object containing the number of lines specified by numLinesToRead.
fileToString(String) - Method in class Tail
A helper function that converts the given file to a String object containing the number of lines specified by numLinesToRead.

G

getCommand() - Method in class JShell
Retrieves the current command inputted interactively by user.
getDescription() - Method in class Cat
 
getDescription() - Method in class Cd
 
getDescription() - Method in class Command
Returns a description of the command.
getDescription() - Method in class Date
 
getDescription() - Method in class Dirs
 
getDescription() - Method in class Echo
 
getDescription() - Method in class Head
 
getDescription() - Method in class Ls
 
getDescription() - Method in class Popd
 
getDescription() - Method in class Printenv
 
getDescription() - Method in class Pushd
 
getDescription() - Method in class Pwd
 
getDescription() - Method in class Setenv
 
getDescription() - Method in class Sort
 
getDescription() - Method in class Tail
 
getDescription() - Method in class Unsetenv
 
getDescription() - Method in class Wc
 
getLineCount() - Method in class Wc
A helper function that returns the line count of the current file.
getPath() - Method in class FileInfo
Returns a file path.

H

Head - class Head.
The Head class (a subclass of the abstract base class Command) implements the familiar unix command head, which outputs the first number of lines of each file.
Head() - Constructor for class Head
 

J

JShell - class JShell.
The JShell class is this program's main class and is called to run the program (i.e. java JShell).
JShell() - Constructor for class JShell
Constructs a new JShell object by initializing the field myCommands with each type of supported command.

L

listToString() - Method in class Sort
A helper function that converts the vector object sortList to a String object to be returned by execute.
Ls - class Ls.
The Ls class (a subclass of the abstract base class Command) implements the familiar unix command ls, which does the following: for each file that is a directory, ls outputs the contents of the directory; for each file that is an ordinary file, ls outputs its name.
Ls() - Constructor for class Ls
 

M

main(String[]) - Static method in class JShell
JShell's main function - calls getCommand() and runCommand() to process and execute input line until until user ends program via "logout".
myCharCount - Variable in class Wc
Number of characters in file.
myCommand - Variable in class FileInfo
Current command.
myCurrentPath - Variable in class FileInfo
Current path.
myLineCount - Variable in class Wc
Number of lines in file.
myName - Variable in class FileInfo
File path entered by user.
myResult - Variable in class FileInfo
Error message for non-existent file.
myTempPath - Variable in class FileInfo
Resultant path name.
myWordCount - Variable in class Wc
Number of words in file.

N

numLinesToRead - Variable in class Head
An int value containing the number of lines to read from file.
numLinesToRead - Variable in class Tail
An int value containing the number of lines to read from file.
numList - Variable in class Head
A vector containing numerical arguments to head.
numList - Variable in class Tail
A vector containing numerical arguments to tail.

P

Popd - class Popd.
The Popd class (a subclass of the abstract base class Command) implements the familiar unix command popd, which pops a directory from the directory stack and changes the working directory to that directory.
Popd() - Constructor for class Popd
 
Printenv - class Printenv.
The Printenv class (a subclass of the abstract base class Command) implements the familiar unix command printenv, which outputs all environment variables and their respective values.
Printenv() - Constructor for class Printenv
 
processArgs(String) - Method in class Head
A helper function that parses the arguments of this command into appropriate containers.
processArgs(String) - Method in class Tail
A helper function that parses the arguments of this command into appropriate containers.
processDirectory(String) - Method in class Ls
A helper function that appends the contents of the given file to a result String object to be returned by execute.
processSort(String) - Method in class Sort
A helper function that adds each line of the specified file to sortList.
Pushd - class Pushd.
The Pushd class (a subclass of the abstract base class Command) implements the familiar unix command pushd, which pushes the current directory onto the directory stack and changes the working directory to its argument.
Pushd() - Constructor for class Pushd
 
Pwd - class Pwd.
The Pwd class (a subclass of the abstract base class Command) implements the familiar unix command pwd, which outputs the working directory name.
Pwd() - Constructor for class Pwd
 

R

runCommand(String) - Method in class JShell
Executes the current command.

S

Setenv - class Setenv.
The Setenv class (a subclass of the abstract base class Command) implements the familiar unix command setenv, which maps its first string argument to its remaining arguments.
Setenv() - Constructor for class Setenv
 
Sort - class Sort.
The Sort class (a subclass of the abstract base class Command) implements the familiar unix command sort, which sorts the lines of all named files together and outputs the result.
Sort() - Constructor for class Sort
 
sortList - Variable in class Sort
A vector containing the lines of all named files to be sorted.

T

Tail - class Tail.
The Tail class (a subclass of the abstract base class Command) implements the familiar unix command tail, which outputs the last number of lines of each file.
Tail() - Constructor for class Tail
 

U

Unsetenv - class Unsetenv.
The Unsetenv class (a subclass of the abstract base class Command) implements the familiar unix command unsetenv, which removes the specified variable name from environment.
Unsetenv() - Constructor for class Unsetenv
 
Update(String) - Method in class Wc
A helper function that updates the result to be passed back through execute with the counts of the number of lines, words, and characters in the current file.

W

Wc - class Wc.
The Wc class (a subclass of the abstract base class Command) implements the familiar unix command wc, which outputs a count of lines, words, and characters in each file.
Wc() - Constructor for class Wc
 

A C D E F G H J L M N P R S T U W