#PLEASE DO NOT EDIT THIS CODE #This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language! # line 3 "../ImmutableUnidirectionalOneTest.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 if not self.setMentor(aMentor) : raise RuntimeError ("Unable to create Student due to aMentor. See https://manual.umple.org?RE002ViolationofAssociationMultiplicity.html") #------------------------ # INTERFACE #------------------------ def getNumber(self): return self._number # Code from template association_GetOne def getMentor(self): return self._mentor # Code from template association_SetUnidirectionalOne def setMentor(self, aNewMentor): wasSet = False if not self._canSetMentor : return False self._canSetMentor = False if not (aNewMentor is None) : 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 "../ImmutableUnidirectionalOneTest.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()) + "]"