****************************

README

Elevator Problem

Bank of America, Code Review

Steve Talbot
stevetalbot100@hotmail.com
773.647.1171

****************************

The program was written using the Eclipse IDE version 3.2

The program can be run within Eclipse, or from the command line.

****************************

I. Eclipse

1. Start Eclipse.

2. Navigate to the file name "B_of_A_Code_Review".

3. Look at the left hand side "Package Explorer" window.

4. Open the Project named "B_of_A_Code_Review".

5. Open the Packages name "commands" and "main".

The following file structure should be seen:

B_of_A_Code_Review [project]
|
 - commands [package]
   |
   - CommandPair.java
   - CommandSubset.java
   - CommandSubsetsContainer.java
|
 - main [package]
   |
   - Elevator.java
   - ElevatorMain.java
   - UpOrDown.java

If the above file structure is not seen in this window, do the following:

a. Select "File->Import", "General->File System", click "Next" button.
b. Click the "Browse" button.
c. Navigate to the location of the file "B_of_A_Code_Review".
d. Select the check box next to the entry "B_of_A_Code_Review".
e. Select finish.

The project should be imported into the "Package Explorer" window.

6. To run the program, right click on the file "ElevatorMain.java".

7. Select "Run As -> Run...".

8. Select the "Arguments" tab.

9. In the "Program Arguments" window, type "input.txt A" or "input.txt B"
   This represents the input arguments (arg[0] and arg[1]) for the main method
   in "ElevatorMain.java".

10. Click the "Run" button to run the program.

Note: right clicking any other Class and selecting "Run As -> Run..."
will run its "main()" method, but that was for unit testing purposes only.

****************************

II. Command Line

1. Make sure that the proper environment variables are set correctly.

2. Click the "Start" button, select "Settings->Control Panel"

3. Select "System" icon.

4. Select the "Advanced" tab, and click the "Environment Variables" button.

5. Select the "PATH" variable from the list, and click the "Edit" button.

6. Make sure that the fully qualified path to the "java" program is present
   i.e.: ";C:\Program Files\Java\jdk1.6.0_05\bin" where the semi-colon
   is used to separate entries

7. Select the "CLASSPATH" variable from the list, and click the "Edit" button.

8. Make sure that the fully qualified path to the directory where the file
   "main/ElevatorMain.class" is found is in the classpath.
   i.e.: ";C:\Temp\B_of_A_Code_Review\B_of_A_Code_Review\main"
   where the semi-colon is used to separate entries

9. Click the OK button twice to save the choices.

10. Restart the computer so that your changes are updated in the system.

11. Click "Start" button, "Programs->Accessories->Command Prompt" to open a command prompt.

12. Change the directory until it is 1 directory above the directory where the file
    "ElevatorMain.class" is located.
    i.e.: is the file is in "C:\Temp\B_of_A_Code_Review\B_of_A_Code_Review\main", 
    navigate to the directory above: "C:\Temp\B_of_A_Code_Review\B_of_A_Code_Review"

13. issue the following commands:
    "java -cp . main/ElevatorMain input.txt A" OR "java -cp . main/ElevatorMain input.txt B"
    for "mode A" and "mode B", respectively.
    
    NOTE: the "-cp" option means we are designating the classpath on the fly, and the "."
    that follows it indicates that the java program should use the current directory.

****************************

III. Class Structure

"ElevatorMain" contains:

		"ArrayList<CommandPair>"
		
		"ArrayList<Integer>"
		
		"ArrayList< ArrayList<CommandPair> >"
               
		"ArrayList<CommandPair>"
		
		"CommandSubsetsContainer"

"CommandSubsetsContainer" contains:

		"ArrayList<CommandPair>"
		
		"ArrayList<CommandSubset>"

"CommandSubset" contains:

		"ArrayList<CommandPair>"

"Elevator" contains:

		the "UpOrDown" enumeration and a primitive variable

"CommandPair" contains:
	
		primitive variables


****************************

IV. Class Invocations

"ElevatorMain" 

	-> "CommandSubsetsContainer"

	-> "CommandSubset"
	
	-> "Elevator"
	
	-> "UpOrDown"
	
	-> "CommandPair"
	
"CommandSubsetsContainer"

	-> "CommandPair"
	
	-> "UpOrDown"
	
	-> "CommandSubset"
	
"CommandSubset"

	-> "CommandPair"
	
	-> "UpOrDown"
	
"Elevator"
	
	-> "UpOrDown"
	
"CommandPair"

	-> none