Skip to content

fiabot/CommandLineSimulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

------------------------
Command Line Simulation 
-----------------------

This program simulations a command line with a folder hierarchy and text files. To run a command line, create new command line and run the method runCommandLine. The main function of CommandLine does this for you. To know what commands can be used, type help into the command line and the complete list of all commands on their functions will be provided.  

-------------------------
Installation Requirements
-------------------------
Everything in this package can be run using the basic java libraries (Java.util). 

 -------------------------
Code Explanation 
-------------------------

Folder navigation - navigation of the folder hierarchy is done through the FolderTree and FolderTreeNode data structure. This allows for going inbetween parents and children easily. 
Undo/Redo - The stack data structure is used to undo and redo action and commands in the file editor and command line. This is done by having every file version and every command pushed unto the history stack. When the undo method is called, the top entry is popped from the history stack and added to a second stack. When the redo method is called, the top entry of the second stack is popped and returned. 
Command/Keyword access - Every action has a keyword that is type by the user to access it. To find the command associated with a keyword, a hashmap was used that stored the string keyword to the action. To store actions, the Command interface was used that contained two method, execute which take the string given by the user and the command line, along with info which returned a string for how the command is used. 
Folder Tree Nodes - Folder tree nodes implemented the general tree node interface. They contained a reference to their parent node, along with children nodes using an ArrayList to store them all. 
Stack - The stack data structure was implemented using a linked list.   

About

Basic simulation of file and folder system with command line commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages