#PLEASE DO NOT EDIT THIS CODE #This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language! # line 3 "../UnidirectionalOneTest.ump" import os class Mentor(): #------------------------ # MEMBER VARIABLES #------------------------ #Mentor Attributes #Mentor Associations #------------------------ # CONSTRUCTOR #------------------------ def __init__(self, aName, aStudent): self._student = None self._name = None self._name = aName if not self.setStudent(aStudent) : raise RuntimeError ("Unable to create Mentor due to aStudent. See https://manual.umple.org?RE002ViolationofAssociationMultiplicity.html") #------------------------ # INTERFACE #------------------------ def setName(self, aName): wasSet = False self._name = aName wasSet = True return wasSet def getName(self): return self._name # Code from template association_GetOne def getStudent(self): return self._student # Code from template association_SetUnidirectionalOne def setStudent(self, aNewStudent): wasSet = False if not (aNewStudent is None) : self._student = aNewStudent wasSet = True return wasSet def delete(self): self._student = None def __str__(self): return str(super().__str__()) + "[" + "name" + ":" + str(self.getName()) + "]" + str(os.linesep) + " " + "student = " + ((format(id(self.getStudent()), "x")) if not (self.getStudent() is None) else "null") #PLEASE DO NOT EDIT THIS CODE #This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language! # line 9 "../UnidirectionalOneTest.ump" class Student(): #------------------------ # MEMBER VARIABLES #------------------------ #Student Attributes #------------------------ # CONSTRUCTOR #------------------------ def __init__(self, aNumber): self._number = None self._number = aNumber #------------------------ # INTERFACE #------------------------ def setNumber(self, aNumber): wasSet = False self._number = aNumber wasSet = True return wasSet def getNumber(self): return self._number def delete(self): pass def __str__(self): return str(super().__str__()) + "[" + "number" + ":" + str(self.getNumber()) + "]"