/********************************************** Date: August 10, 2008 Purpose: This is an airline example which models the data obtaines from Air Canada scheduling web page. This example is meant to show a more realistic use of Umple and Umple software. ***********************************************/ use queryLogic.jump namespace airlineMajorExample //namespace airlineMajorExample.core class FlightTracker{ singleton; VANCOUVER = "YVR"; HONGKONG = "HKG"; SYDNEY = "SYD"; TORONTO = "YYZ"; BUENOSAIRES = "EZE"; SANTIAGO = "SCL"; CALGARY = "YYC"; OTTAWA = "YOW"; STJOHNS = "YYT"; HALIFAX = "YHZ"; 1 -- * RegularFlight; } class RegularFlight{ unique flightNo; 1 -- 0..* RegularLeg; 1 -- 0..* RegularFlightSchedule; } class RegularLeg{ * flightsTo -- 1 Airport destination; * flightsFrom -- 1 Airport origin; 1 -- * RegularLegSchedule; } class RegularFlightSchedule{ effectiveDate; discontinuedDate; 1 -- 0..* RegularLegSchedule; } class RegularLegSchedule{ depTime; arrTime; Integer midnightCrossings; * -> 1 Frequency regsched; } class AirplaneType{ typeCode; 1 -- * RegularFlightSchedule; public String toString(){ return "Airplane type: " + typeCode; } } class Airport{ unique String code; //Default case name = "UNKNOWN_NAME"; public String toString(){ return name+"("+code+")"; } } class Frequency{ Boolean monday; Boolean tuesday; Boolean wednesday; Boolean thursday; Boolean friday; Boolean saturday; Boolean sunday; /*************************************** Represents each requency as numeric code. *****************************************/ public String toString(){ String codeRepresentationOfFrequency = "" ; if(monday) codeRepresentationOfFrequency += "1"; if(tuesday) codeRepresentationOfFrequency += "2"; if(wednesday) codeRepresentationOfFrequency += "3"; if(thursday) codeRepresentationOfFrequency += "4"; if(friday) codeRepresentationOfFrequency += "5"; if(saturday) codeRepresentationOfFrequency += "6"; if(sunday) codeRepresentationOfFrequency += "7"; return codeRepresentationOfFrequency; } }