Lab 1440 - Royal Navy, 1894

Description

This project processes two data files - one containing information about ships and the other containing information about officers - in the Royal Navy in 1894. The ships, with their data, are processed into a linked list. Then the officers and their information are processed into another linked list. Finally each ship in the first linked list is populated with their crew, as specified in the second link list as described. The resulting data structure is a linked list of ships, with each node containing a linked list of officers assigned to that ship in 1894.

Format of the Data Files

This is the format of the ships.dat data file

H.M.Ship         Guns/Tons/HP   Station
---------------  -------------  ------------------
Abyssinia        4/2900/..      Bombay India
Achilles         16/9800/4000   Portsmouth

Regarding the ships.dat information:

  1. The number of guns, the ships tonnage and the horsepower of the engines are given e.g. 16 Guns/9800 tons/ 400 Horse Power.
  2. Ships that have an asterisk "*" after their names means that they were sailing vessels.
  3. Those with "+" after their name were paddle steamers.
  4. "Particular Service" (Part.Service) means that the ship was operating on its own and not as part of a squadron under an Admiral.
  5. "Coastguard" was a term used to describe the service of some ships during the period 1857-1923 when under the control of the Admiralty and consisted of ships manned by Officers on Half-pay and by former naval ratings. The 'Coastguard' consisted of "The Shore Force", "The Permanent Cruiser Force" and "The Guard Ships". The ships listed as "Coastguard" were Guardships.
  6. Ships shown as being "Reserve at....." were stationed at the named ports as drill ships for the Reserves.

This is the format of the officers.dat data file

NAMES                 RANK            H.M.Ship
--------------------- --------------- --------
A'COURT John          Fleet Engineer  Himalaya
ACLAND William A.Dyke Captain         Edgar
ADAIR Thomas B.S.     First Lieut.    Excellent *

Regarding the officers.dat information:

  1. Names of Officers listed in Whitaker's Alamanac for 1894 as serving in ships in commission or in reserve in various parts of the world.
  2. Ships that have an asterisk "*" after their names means that they were sailing vessels.
  3. Those with "+" after their name were paddle steamers.
  4. In transcribing the data, all reference to titles, orders and decorations has been omitted.
  5. The rank "Lieut in Command" has been transcribed as "Lieut Cdr".
Assignment

Use appropriate OOP techniques for the project. You will use two source files, ships.dat and officers.dat as provided. You will need to write two classes for your data types: Ship.java and Officer.java. The Ship class needs to include an embedded linked list that will be populated with the officers of that ship.

You will need to write two classes that extend java.util.LinkedList (or your equivalent Linked List base class) to create two linked lists from the data: ShipListFromFile.java and OfficerListFromFile.java. The ShipListFromFile constructor populates its LinkedList from the Ship.java data file. The EasyReader class can simplify getting the data from the ships.dat and officers.dat files.

Your main program, ShipIndex.java should first create the officer and ships lists. Then, using nested iterators, it should put the officers in the OfficerListFromFile linked list into the personnel list in their assigned ships as stored in the ShipListFromFile linked list. Finally, the main program will display all ships, with their personnel, again using iterators appropriately.

Your results for the first three ships should look like this:

Abyssinia: 
  ELDERTON Ferdinand H, Lieut
  MOYSEY John, Fleet Engineer
Achilles: 
  DICKSON David L., Commander
  McCARTHY John, Staff Engineer
Active: 
  ASKHAM Alfred W., Staff Paymaster
  COKE Charles H., Commander
  DOUGHERTY John A., Chaplain
  HARRIS Robert H., Commodore
  HUGHES Sidney, First Lieut.
  JOHNSTON Alex. J.J., Staff Surgeon
  WHITE William H., Fleet Engineer

Copyright © 2010 by Asylum Computer Services LLC Return to CS Labs