public boolean addAccess(Accesses aAccess) { boolean wasAdded = false; if (accesses.contains(aAccess)) { return false; } if (accesses.contains(aAccess)) { return false; } if (accesses.contains(aAccess)) { return false; } if (accesses.contains(aAccess)) { return false; } BehaviouralElement existingBehaviouralElement = aAccess.getBehaviouralElement(); boolean isNewBehaviouralElement = existingBehaviouralElement != null && !this.equals(existingBehaviouralElement); if (isNewBehaviouralElement) { aAccess.setBehaviouralElement(this); } else { accesses.add(aAccess); } wasAdded = true; return wasAdded; }
public boolean removeAccess(Accesses aAccess) { boolean wasRemoved = false; // Unable to remove aAccess, as it must always have a behaviouralElement if (!this.equals(aAccess.getBehaviouralElement())) { accesses.remove(aAccess); wasRemoved = true; } return wasRemoved; }
public void delete() { for (int i = invoked.size(); i > 0; i--) { Invokes aInvoked = invoked.get(i - 1); aInvoked.delete(); } for (int i = invokes.size(); i > 0; i--) { Invokes aInvoke = invokes.get(i - 1); aInvoke.delete(); } for (int i = accesses.size(); i > 0; i--) { Accesses aAccess = accesses.get(i - 1); aAccess.delete(); } for (int i = isParameterOfs.size(); i > 0; i--) { IsParameterOf aIsParameterOf = isParameterOfs.get(i - 1); aIsParameterOf.delete(); } super.delete(); }