Vous êtes sur la page 1sur 8

Name: Dylan Veraart

Date: 3/21/2019
Course: CMSC 335 – Object-Oriented and Concurrent Programming
Project: 1

1 Source code, data files, and configuration files (if any)


Insert a zipped file of NetBeans ALL project files (so that it could be unzipped and loaded
into NetBeans IDE again), zipped file of all data files, and zipped file of configuration files
(if any). :

2 Design
Insert here UML Class diagram, explain classes, variables, methods, explain how classes
tie to the requirements of the project:

The basic purpose of the program is to read in a file, parse each line into a hierarchy of
objects related to parts of a Seaport, display the hierarchy in a readable format and
provide search functions for various fields in each object. The SeaPortProgram class
contains the main function, and serves to create the GUI, and create a World object
which is fed the file. The World class contains search functions and parses each line into
objects. It also maintains a list of SeaPort objects which make up the World. SeaPort
objects maintain four lists, three of which keep comprehensive track of a SeaPort’s child
Dock, Person, and Ship objects. Docks can have a single child Ship. Ships can be further
described as PassengerShips or CargoShips. This describes the basic hierarchy. The Job
and PortTime classes serve as placeholder for future projects. The InvalidInputException
class is used for debugging and error handling an incorrectly typed input file. It is not a
requirement of the project as we are meant to assume that any file tested will be valid.
Further info on each method and greater explanation of each class can be found in the
comments of the program itself.

3 User Guide
Explain how a user starts & runs your project, and any specific features with screenshots:

After compiling and running the program, a file can be opened from the File menu and
selecting open. A text file to be parsed can be navigated to and opened from here. Once
open, the file is displayed in the large text area at the bottom of the window and can be
scrolled through. The file can also be searched with the bar at the top. The search bar
consists of three main elements: a combo box where you can select the search type, a
text field where you can enter your query, and a search button where you can request
results (hitting enter while the text field is selected also works). The combo box allows
you to search various different object fields. By either object name, index, skill, parent
index, or parent name. Each result will be listed on a separate line in the large text area at
the bottom of the GUI. If no results are found it will state as such in the text area. one can
re-display the initial formatting of the whole file by selecting the File menu and choosing
the “Display File” option.

4 Test Plan
Complete this table and extend it with your test cases:

Tes Test Case Selecte Expected Output Actual Output Pass/


t ID d Input (Screenshots) Fail
1 Example test Open: >>>>> The world:
case. An exact testCas
copy of the test e1.txt
case in the SeaPort: Lanshan 10000
directions.
Open the file
provided. Dock: Pier_4 20004
Ship: Passenger Ship: ✓
Absentmindedness 30004

Dock: Pier_0 20000


Ship: Passenger Ship:
Gallinules 30000

Dock: Pier_1 20001


Ship: Passenger Ship:
Remora 30001

Dock: Pier_3 20003


Ship: Passenger Ship:
Preanesthetic 30003

Dock: Pier_2 20002


Ship: Passenger Ship:
Shoetrees 30002

--List of all ships in queue:


>Cargo Ship: Erosional
40001
>Cargo Ship: Kielbasas
40000
>Cargo Ship: Generics
40002
>Cargo Ship: Barcelona
40003
>Cargo Ship: Toluene
40004

--List of all ships


>Passenger Ship:
Gallinules 30000
>Passenger Ship: Remora
30001
>Passenger Ship:
Absentmindedness 30004
>Passenger Ship:
Preanesthetic 30003
>Passenger Ship:
Shoetrees 30002
>Cargo Ship: Erosional
40001
>Cargo Ship: Kielbasas
40000
>Cargo Ship: Generics
40002
>Cargo Ship: Barcelona
40003
>Cargo Ship: Toluene
40004
--List of all persons
>Person: Sara 50000
>Person: Duane 50002
>Person: Betsy 50004
>Person: Archie 50003
>Person: Thomas 50001

2 With testFile1 Type: Cargo Ship: Barcelona


loaded Index 40003
Search by Index Text: ✓
40003
3 With testFile1 Type: No results found.
loaded Index
Search by Index Text: ✓
Barcel
ona
4 With testFile1 Type: Person: Duane 50002
loaded Name
Search by Text: ✓
Name Duane
5 With testFile1 Type: No results found.
loaded Name
Search by Text: ✓
Name 30003
6 With testFile1 Type: Person: Thomas 50001
loaded Skill
Search by Skill Text: ✓
Clerk
7 After File -> [same as test 1]
performing a Display
search with File
testFile1,
Display file

8 Open file with Open: >>>>> The world:
two ports testCas
default ships, e2.txt
unusual line SeaPort: Lanshan 10002
order, and an
unknown ship
in a dock Dock: Pier_4 20004
Ship: Passenger Ship:
Absentmindedness 30004

Dock: Pier_0 20000


Ship: Ship: ERROR:
Unknown Ship 30010

Dock: Pier_1 20001


Ship: Passenger Ship:
Remora 30001

Dock: Pier_3 20003


Ship: Passenger Ship:
Preanesthetic 30003

Dock: Pier_2 20002 ✓


Ship: Ship: Shoetrees
30002

Dock: Pier_9 20007


Ship: Passenger Ship:
Choetrees 30007

--List of all ships in queue:


>Passenger Ship:
Gallinules 30000
>Cargo Ship: Erosional
40001
>Cargo Ship: Kielbasas
40000
>Cargo Ship: Generics
40002
>Cargo Ship: Barcelona
40003
>Cargo Ship: Toluene
40004
>Passenger Ship:
Dallinules 30005
--List of all ships
>Passenger Ship:
Gallinules 30000
>Passenger Ship: Remora
30001
>Passenger Ship:
Absentmindedness 30004
>Passenger Ship:
Preanesthetic 30003
>Ship: Shoetrees 30002
>Cargo Ship: Erosional
40001
>Cargo Ship: Kielbasas
40000
>Cargo Ship: Generics
40002
>Cargo Ship: Barcelona
40003
>Cargo Ship: Toluene
40004
>Passenger Ship:
Dallinules 30005
>Passenger Ship:
Choetrees 30007

--List of all persons


>Person: Sara 50000
>Person: Duane 50002
>Person: Betsy 50004
>Person: Archie 50003
>Person: Thomas 50001
>Person: Thomas 50006

SeaPort: Macau 10001

Dock: Pier_4 20009


Ship: Cargo Ship: Boluene
40009

Dock: Pier_0 20005


Ship: Passenger Ship:
Remora 30001
Dock: Pier_1 20006
Ship: Passenger Ship:
Gemora 30006

Dock: Pier_3 20008


Ship: Passenger Ship:
Treanesthetic 30008

--List of all ships in queue:


>Passenger Ship:
Obsentmindedness 30009
>Cargo Ship: Irosional
40006
>Cargo Ship: Cielbasas
40005
>Cargo Ship: Henerics
40007
>Ship: Warcelona 40008

--List of all ships


>Passenger Ship: Gemora
30006
>Passenger Ship:
Obsentmindedness 30009
>Passenger Ship:
Treanesthetic 30008
>Cargo Ship: Irosional
40006
>Cargo Ship: Cielbasas
40005
>Cargo Ship: Henerics
40007
>Ship: Warcelona 40008
>Cargo Ship: Boluene
40009

--List of all persons


>Person: Tommy 50005
>Person: Duane 50007
>Person: Donnie 50009
>Person: Archie 50008
9 Multiple search Type: Passenger Ship: Gallinules
results from Parent 30000
testFile2.txt Name Cargo Ship: Erosional 40001
Text: Cargo Ship: Kielbasas 40000
Lansha Cargo Ship: Generics 40002
n Cargo Ship: Barcelona
40003
Cargo Ship: Toluene 40004
Passenger Ship: Dallinules
30005
Dock: Pier_4 20004

Dock: Pier_0 20000
Dock: Pier_1 20001
Dock: Pier_3 20003
Dock: Pier_2 20002
Dock: Pier_9 20007
Person: Sara 50000
Person: Duane 50002
Person: Betsy 50004
Person: Archie 50003
Person: Thomas 50001
Person: Thomas 50006

5 Reflection and Lessons Learned


Reflect on your experience completing this project and the lessons you learned:

I felt that, for the most part, I learned very little programming from this project and more
about the demands from this class. I’m hoping this is just because the first project is
meant to be a foundation for future projects. I spent most of my time struggling with
creating the documentation or to understand the directions which frequently omitted
things, or listed contradictory requirements. There were also some specifications of the
assignment that felt as though they could be drastically improved. For instance, rather
than iterating through an entire ArrayList to find an object with a particular index value a
HashMap would be much better for searching by a given predefined index. For Dock
objects, storing a whole Ship object seems excessive when instead you could just store
the Ship index.

Vous aimerez peut-être aussi