Classes in UML and Java - David Meredith's Web Site
Download
Report
Transcript Classes in UML and Java - David Meredith's Web Site
Classes in UML and Java
Obect-Oriented Analysis, Design and Programming
http://moodle.vrml.aau.dk/course/view.php?id=21
Medialogy Semester 4
Aalborg University
David Meredith
[email protected]
Appointment class in UML
Appointment
-date: Date
-startTime: Time
-endTime: Time
-place: String
-description: String
«create» +Appointment()
«create» +Appointment(date: Date, startTime: Time, endTime: Time, place: String, description: String)
+getDate(): Date
+setDate(newDate: Date)
+getStartTime(): Time
+setStartTime(newTime: Time)
+getEndTime(): Time
+setEndTime(newTime: Time)
+getPlace(): String
+setPlace(newPlace: String)
+getDescription(): String
+setDescription(newDescription: String)
+toString(): String
+equals(obj: Object) : boolean
+compareTo(Appointment apt): int
Date class in UML
Date
-dayOfMonth: Integer
-year: Integer
-month: Month
«create» +Date()
«create» +Date(dayOfMonth: Integer, month: Month, year: Integer)
+getDayOfMonth(): Integer
+setDayOfMonth(newDayOfMonth: Integer)
+getYear(): Integer
+setYear(newYear: Integer)
+getMonth(): Month
+setMonth(newMonth: Month)
+toString(): String
+compareTo(date: Date): int
+equals(obj: Object): boolean
Time class in UML
Time
-hour: Integer
-minute: Integer
«create» +Time()
«create» +Time(hour: Integer, minute: Integer)
+getHour(): Integer
+setHour(newHour: Integer)
+getMinute(): Integer
+setMinute(newMinute: Integer)
+equals(obj: Object): boolean
+compareTo(time: Time): int
+toString(): String
Month enumeration type in UML
«enumeration»
Month
JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER