Devam Ediyor

521389 an editing environment for travel maps.

In this project you will develop an editing environment for travel maps. For this assignment you will develop the basic infrastructure for reading in a representation of a map, and computing distances.

2 Description

The goal of this assignment is to create a Java class to store places and routes of a travel network, and allow trip distances to be calculated. In addition, you will write a class that can read/write a map from/to a text file. The external behaviour is prescribed by interfaces we provide.

3 Map file format

The file describing a map is a series of records, structured as lines of text. The are five different type of lines to specify places, roads, starting and ending points for a trip, and comments.

3.1 Place record

place placeName xpos ypos

Where:

� place is the character string �place�.

� placeName is the name of the place, a string of characters beginning with a letter, followed by zero or more letter, digit, or underscore characters. (This is essentially the definition of �identifier� in Java.)

� xpos and ypos are integer values that give the x- and y-position of the place on the computer's display screen. Although you will not need these values for this stage of the project, you must store and reproduce them correctly.

3.2 Road record

road firstPlace secondPlace roadName length

Where: � road stands for the character string �road�; � firstPlace is the name of the place at one end of the road; � secondPlace is the name of the place at the other end of the road;

� roadName is the name of the this road. A roadName is character string that starts with a letter, and is followed by letters or digits. The special roadName - means the road does not have a name.

1

� length is the length of this road, in kilometres. Note that a road is symmetric � it is possible to travel from a to b, and from b to a.

3.3 Start record

start placeName

Where: � start stands for the character string �start�; � placeName specifies the starting place for a trip on the map.

3.4 End record

end placeName

Where: � end stands for the character string �end�; � placeName specifies the ending place for a trip on the map.

3.5 Comment record

A line that begins with the character �#� is a comment, and is ignored by the system.

3.6 Order of records

Records can appear in any order in the file, with one restriction: a place name must have been defined via a place record before its name can be used in a road, start, or end record. When writing a file, it is conventional to write the records in the order: place, road, start, then end.

4 What we provide

We provide the following java files for you:

[url removed, login to view] contains an interface specification for a class that stores a representation of a map.

[url removed, login to view] contains an interface specification for a class that stores a representation of a Place.

[url removed, login to view] contains an interface specification for a class that stores a representation of a Road.

[url removed, login to view] contains an interface specification for a class that can read or write a map from a textfile.

[url removed, login to view] Specifies an exception that is thrown when an error is detected while reading a map specification.

[url removed, login to view] contains an interface that is used to notify listeners when a change has been made to a place.

[url removed, login to view] contains an interface that is used to notify listeners when a change has been made to a road.

[url removed, login to view] contains an interface that is used to notify listeners when a change has been made to the map.

[url removed, login to view] contains an example map.

5 What you must do

You must write two java classes: [url removed, login to view] that implements the Map interface, and contains a default constructor: public MapImpl(), and [url removed, login to view] that implements the MapIo inteface, and contains a default constructor MapReaderWriter()

Beceriler: Her şey Kabul, Makale Yeniden Yazım, Düzenleme, Java

Daha fazlasını görün: mapimpl xpos ypos, writing to a file java, writing to a file in java, writing road to reading, writing road map, writing for travel, writing and editing for you, writing a letter format, writing a character letter, write five basic need, the writing road to reading, stage stores, other name for editing, on line map, on line editing, map string, letter writing format, java writing to a file, goal zero, format for writing a letter, does c have classes, definition of writing, what is travel writing, what is editing in writing, definition of format

İşveren Hakkında:
( 0 değerlendirme ) adelaide,

Proje NO: #2267327