From bead0ba5eca3a3b18c6ddc494d46dfbfa4b75a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ronny=20B=C3=B6ttger?= <s6013406@mail.zih.tu-dresden.de> Date: Thu, 14 Jul 2022 22:29:25 +0200 Subject: [PATCH] renamed roles() to fulfillments() --- .../src/main/jastadd/AttributeGetters.jadd | 4 ++-- statemachine.solution/src/main/jastadd/Plays.jadd | 6 +++--- statemachine.solution/src/main/jastadd/Printing.jrag | 9 +++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/statemachine.solution/src/main/jastadd/AttributeGetters.jadd b/statemachine.solution/src/main/jastadd/AttributeGetters.jadd index e21a7d4..ac85e67 100644 --- a/statemachine.solution/src/main/jastadd/AttributeGetters.jadd +++ b/statemachine.solution/src/main/jastadd/AttributeGetters.jadd @@ -9,11 +9,11 @@ aspect AttributeGetters { public Attribute RigidType.getNewestAttribute(String name) { Attribute match = null; - for (Fulfillment f : roles()) { + for (Fulfillment f : fulfillments()) { Attribute a = f.getFilled().getAttributeByName(name); if (a != null) match = a; } - if (roles().isEmpty() || match == null) return getAttributeByName(name); + if (fulfillments().isEmpty() || match == null) return getAttributeByName(name); return match; } diff --git a/statemachine.solution/src/main/jastadd/Plays.jadd b/statemachine.solution/src/main/jastadd/Plays.jadd index f10a506..4bc6c7a 100644 --- a/statemachine.solution/src/main/jastadd/Plays.jadd +++ b/statemachine.solution/src/main/jastadd/Plays.jadd @@ -1,11 +1,11 @@ aspect Plays { - coll ArrayList<Fulfillment> RigidType.roles() + coll ArrayList<Fulfillment> RigidType.fulfillments() [new ArrayList<Fulfillment>()] with add; //PersonConsultantFulfillment contributes this Fulfillment contributes this - to RigidType.roles() + to RigidType.fulfillments() for getFiller(); @@ -25,7 +25,7 @@ aspect Plays { //} public void RigidType.unplays(RoleType rt) { - roles().removeIf(element -> (element.getFilled().equals(rt))); + fulfillments().removeIf(element -> (element.getFilled().equals(rt))); } /*------------------------------------------------------------------------------------------------------------------ diff --git a/statemachine.solution/src/main/jastadd/Printing.jrag b/statemachine.solution/src/main/jastadd/Printing.jrag index ac18338..0b7b970 100644 --- a/statemachine.solution/src/main/jastadd/Printing.jrag +++ b/statemachine.solution/src/main/jastadd/Printing.jrag @@ -16,9 +16,9 @@ aspect Printing { eq NaturalType.prettyPrint() { StringBuilder sb = new StringBuilder(); sb.append("NT " + getName()); - if (!roles().isEmpty()) + if (!fulfillments().isEmpty()) sb.append("\n\tPlays "); - for (Fulfillment f : roles()) { + for (Fulfillment f : fulfillments()) { sb.append("\n\t\t" + f.getFilled().getName() + " "); } if (getAttributeList().getNumChild() != 0) @@ -43,6 +43,11 @@ aspect Printing { eq CompartmentType.prettyPrint() { StringBuilder sb = new StringBuilder(); 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) sb.append("\n\tContains "); for (RoleType r : getPartsList()) { -- GitLab