#PLEASE DO NOT EDIT THIS CODE #This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language! # line 3 "../ImmutableUnidirectionalOptionalOneTest.ump" import os class Student(): #------------------------ # MEMBER VARIABLES #------------------------ #Student Attributes #Student Associations #Helper Variables #------------------------ # CONSTRUCTOR #------------------------ def __init__(self, aNumber, aMentor): self._canSetMentor = None self._mentor = None self._number = None self._number = aNumber self._canSetMentor = True self.setMentor(aMentor) #------------------------ # INTERFACE #------------------------ def getNumber(self): return self._number # Code from template association_GetOne def getMentor(self): return self._mentor def hasMentor(self): has = not (self._mentor is None) return has # Code from template association_SetUnidirectionalOptionalOne def setMentor(self, aNewMentor): wasSet = False if not self._canSetMentor : return False self._canSetMentor = False self._mentor = aNewMentor wasSet = True return wasSet def delete(self): pass def __str__(self): return str(super().__str__()) + "[" + "number" + ":" + str(self.getNumber()) + "]" + str(os.linesep) + " " + "mentor = " + ((format(id(self.getMentor()), "x")) if not (self.getMentor() 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 "../ImmutableUnidirectionalOptionalOneTest.ump" class Mentor(): #------------------------ # MEMBER VARIABLES #------------------------ #Mentor Attributes #------------------------ # CONSTRUCTOR #------------------------ def __init__(self, aName): self._name = None self._name = aName #------------------------ # INTERFACE #------------------------ def getName(self): return self._name def delete(self): pass def __str__(self): return str(super().__str__()) + "[" + "name" + ":" + str(self.getName()) + "]"