classDiagram
class Sensor:::providedCodeNoEdit {
+Sensor(etName String, scanTime int)
+checkSystem() String
+scan(x int, y int, width int) int
}
ExtraterrestrialLocator -- ELgorithm : constructs
ExtraterrestrialLocator -- Sensor : constructs
ExtraterrestrialLocator .. LoggingSensor : constructs
Sensor -- ELgorithm : uses
Sensor -- SensorDisplay : uses
LoggingSensor --|> Sensor
ELgorithm -- Point : constructs
class Point:::jdk {
+int x
+int y
+Point(x int, y int)
}
class ExtraterrestrialLocator:::starter {
<<main>>
+main(args String[])$
}
class SensorDisplay:::providedCodeNoEdit
class ELgorithm {
-Sensor sensor
+ELgorithm(sensor Sensor)
+search(x int, y int, width int) Point
}
class LoggingSensor:::part2 {
+LoggingSensor(etName String, scanTime int)
+scan(x int, y int, width int) int
+getScanLog() Map~Area_COMMA_Boolean~
+toString() String
}
LoggingSensor : -Map~Area, Boolean~ scanLog
class Area:::part2 {
-int x
-int y
-int width
+Area(x int, y int, width int)
+getX() int
+getY() int
+getWidth() int
+toString() String
}
LoggingSensor -- Area : constructs
7 Classes
The seven classes depicted in the UML diagram include some code provided in the Jave Runtime Enviroment, other classes you should create or modify, and other classes still will not be necessary until Part 2 of the assignment.
Provided (gray background)
The following classes are provided via pa5.jar, and you should not modify them:
- SensorDisplay
- Sensor
JRE (black background)
The Java Runtime Environment itself provides the Point
class.
Should Create (lavender background)
- ELgorithm
Part 2 (dotted borders)
Should Create (dotted borders, lavender background)
- Area
- LoggingSensor
Should Modify (dotted borders, gray background)
ExtraterrestrialLocator
- change this class to construct a
LoggingSensor
instead of aSensor
. - add a last line to main that is executed when the Extraterrestrial is found and prints the scan log.
- change this class to construct a