inheritanceAPI
index
/home/hv/src/courses/SoftwareDesign/04.Winter/lecture.OO/inheritanceAPI.py

 
Modules
       
types

 
Classes
       
Aircraft
Glider
PassengerAircraft(Aircraft, PassengerVehicle)
Angle
exceptions.Exception
RangeError
PassengerVehicle

 
class Aircraft
    Encapsulates Aircraft properties.
 
  Methods defined here:
__init__(self, heading=None)
__init__([heading:Angle|[0,360[ = Angle(0)]) Aircraft constructor.
__str__(self)
__str__() -> String representation of an Aircraft instance.
 
Example: str(Aircraft(Angle(20))) returns "<Aircraft:3:<Angle:20>>"
getHeading(self)
getHeading() -> Angle
getUID(self)
getUID() -> Unique aircraft ID (Integer)
turn(self, angle=None)
turn([angle:Angle|[0,360[ = Angle(0)]) adds angle to heading.

Data and other attributes defined here:
NumAircraft = 0

 
class Angle
    Encapsulates an Integer 0 <= angle < 360
 
  Methods defined here:
__add__(self, angle)
__add__(angle:Angle or Integer) --> Angle object, sum of self and angle
Raises: 
  TypeError if angle argument is not an Integer nor an Angle
  RangeError if an Integer angle argument is not in [0, 360[ range
__init__(self, value=0)
Angle([0 <= value:Integer = 0 < 360]) constructor.
__str__(self)
__str__() -> String representation of an Angle.
 
Example: str(Angle(20)) returns "<Angle:20>"
getValue(self)
getValue() -> Integer in [0,360[
 
Get the Angle value.
setValue(self, value=0)
setValue([0 <= value:Integer = 0 < 360]) ->
 
Set the Angle value. 
The value is kept in a private variable __data
Raises:
  TypeError if value is not an Integer
  RangeError if value not in [0, 360[ range

 
class Glider(Aircraft)
    Encapsulates Glider (a special kind of Aircraft) properties.
 
  Methods defined here:
__init__(self, heading=None)
__init__([heading:Angle|[0,360[ = Angle(0)]) Glider constructor.
__str__(self)
__str__() -> String representation of a Glider instance.
 
Example: str(Glider(Angle(20))) returns 
         "<Glider:<Aircraft:3:<Angle:20>>:Not Attached>"
attachTowline(self)
attachTowline() attaches towline.
detachTowline(self)
detachTowline() detaches towline.
towlineAttached(self)
towlineAttached() -> 0|1  (whether towline is attached).

Methods inherited from Aircraft:
getHeading(self)
getHeading() -> Angle
getUID(self)
getUID() -> Unique aircraft ID (Integer)
turn(self, angle=None)
turn([angle:Angle|[0,360[ = Angle(0)]) adds angle to heading.

Data and other attributes inherited from Aircraft:
NumAircraft = 0

 
class PassengerAircraft(Aircraft, PassengerVehicle)
    Encapsulates properties of both Aircraft and PassengerVehicle.
(multiple inheritance)
 
 
Method resolution order:
PassengerAircraft
Aircraft
PassengerVehicle

Methods defined here:
__init__(self)
__init__() PassengerAircraft constructor.
__str__(self)
__str__() -> String representation of a PassengerAircraft instance.
 
Example: str(PassengerAircraft()) for the third instantiated Aircraft 
  returns "<PassengerAircraft:<Aircraft:3:<Angle:20>>:<PassengerVehicle:0>>"

Methods inherited from Aircraft:
getHeading(self)
getHeading() -> Angle
getUID(self)
getUID() -> Unique aircraft ID (Integer)
turn(self, angle=None)
turn([angle:Angle|[0,360[ = Angle(0)]) adds angle to heading.

Data and other attributes inherited from Aircraft:
NumAircraft = 0

Methods inherited from PassengerVehicle:
board(self, passengers=0)
board([passengers:PosInteger = 0]) board passengers
isEmpty(self)
isEmpty() -> 1|0 empty status of the vehicle
numPassengers(self)
numPassengers() -> number of passengers (Integer)
unload(self, passengers=0)
unload([passengers:PosInteger = 0]) unload passengers

 
class PassengerVehicle
    Encapsulates an infinite capacity
Passenger Vehicle's properties (number of passengers).
 
  Methods defined here:
__init__(self, passengers=0)
__init__([passengers:PosInteger = 0]) PassengerVehicle constructor.
__str__(self)
__str__() -> String representation of a PassengerVehicle instance.
 
Example: str(PassengerVehicle(10)) returns 
         "<PassengerVehicle:10>"
board(self, passengers=0)
board([passengers:PosInteger = 0]) board passengers
isEmpty(self)
isEmpty() -> 1|0 empty status of the vehicle
numPassengers(self)
numPassengers() -> number of passengers (Integer)
unload(self, passengers=0)
unload([passengers:PosInteger = 0]) unload passengers

 
class RangeError(exceptions.Exception)
    Raised when a value is out of legal range
 
  Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)