Skip to content
Snippets Groups Projects
Commit bead0ba5 authored by Ronny Böttger's avatar Ronny Böttger
Browse files

renamed roles() to fulfillments()

parent a6b8ce9e
No related branches found
No related tags found
No related merge requests found
...@@ -9,11 +9,11 @@ aspect AttributeGetters { ...@@ -9,11 +9,11 @@ aspect AttributeGetters {
public Attribute RigidType.getNewestAttribute(String name) { public Attribute RigidType.getNewestAttribute(String name) {
Attribute match = null; Attribute match = null;
for (Fulfillment f : roles()) { for (Fulfillment f : fulfillments()) {
Attribute a = f.getFilled().getAttributeByName(name); Attribute a = f.getFilled().getAttributeByName(name);
if (a != null) match = a; if (a != null) match = a;
} }
if (roles().isEmpty() || match == null) return getAttributeByName(name); if (fulfillments().isEmpty() || match == null) return getAttributeByName(name);
return match; return match;
} }
......
aspect Plays { aspect Plays {
coll ArrayList<Fulfillment> RigidType.roles() coll ArrayList<Fulfillment> RigidType.fulfillments()
[new ArrayList<Fulfillment>()] with add; [new ArrayList<Fulfillment>()] with add;
//PersonConsultantFulfillment contributes this //PersonConsultantFulfillment contributes this
Fulfillment contributes this Fulfillment contributes this
to RigidType.roles() to RigidType.fulfillments()
for getFiller(); for getFiller();
...@@ -25,7 +25,7 @@ aspect Plays { ...@@ -25,7 +25,7 @@ aspect Plays {
//} //}
public void RigidType.unplays(RoleType rt) { public void RigidType.unplays(RoleType rt) {
roles().removeIf(element -> (element.getFilled().equals(rt))); fulfillments().removeIf(element -> (element.getFilled().equals(rt)));
} }
/*------------------------------------------------------------------------------------------------------------------ /*------------------------------------------------------------------------------------------------------------------
......
...@@ -16,9 +16,9 @@ aspect Printing { ...@@ -16,9 +16,9 @@ aspect Printing {
eq NaturalType.prettyPrint() { eq NaturalType.prettyPrint() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("NT " + getName()); sb.append("NT " + getName());
if (!roles().isEmpty()) if (!fulfillments().isEmpty())
sb.append("\n\tPlays "); sb.append("\n\tPlays ");
for (Fulfillment f : roles()) { for (Fulfillment f : fulfillments()) {
sb.append("\n\t\t" + f.getFilled().getName() + " "); sb.append("\n\t\t" + f.getFilled().getName() + " ");
} }
if (getAttributeList().getNumChild() != 0) if (getAttributeList().getNumChild() != 0)
...@@ -43,6 +43,11 @@ aspect Printing { ...@@ -43,6 +43,11 @@ aspect Printing {
eq CompartmentType.prettyPrint() { eq CompartmentType.prettyPrint() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("CT " + getName()); sb.append("CT " + getName());
if (!fulfillments().isEmpty())
sb.append("\n\tPlays ");
for (Fulfillment f : fulfillments()) {
sb.append("\n\t\t" + f.getFilled().getName() + " ");
}
if (getPartsList().getNumChild() != 0) if (getPartsList().getNumChild() != 0)
sb.append("\n\tContains "); sb.append("\n\tContains ");
for (RoleType r : getPartsList()) { for (RoleType r : getPartsList()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment