diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Account.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Account.java index f0a5587..10f53f1 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Account.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Account.java @@ -3,9 +3,9 @@ public class Account { private Map notifications; public Map getValue() { - Map temp_nil1 = new HashMap<>(); - temp_nil1.put("notifications",this.getNotifications()); - return temp_nil1; + Map temp_nil17 = new HashMap<>(); + temp_nil17.put("notifications",this.getNotifications()); + return temp_nil17; } public Map getNotifications() { return new HashMap<>(notifications); diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Group.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Group.java index 4498ead..faa7d19 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Group.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Group.java @@ -1,22 +1,22 @@ import java.util.*; public class Group { - private List members; private List messages; private Account account; private Accounts accounts; + private List members; public Map getValue() { - Map temp_nil0 = new HashMap<>(); - temp_nil0.put("members",this.getMembers()); - temp_nil0.put("messages",this.getMessages()); - return temp_nil0; - } - public List getMembers() { - return this.members; + Map temp_nil16 = new HashMap<>(); + temp_nil16.put("members",this.getMembers()); + temp_nil16.put("messages",this.getMessages()); + return temp_nil16; } public List getMessages() { return this.messages; } + public List getMembers() { + return this.members; + } public String getMember(int mno) { return this.members.get(mno); } @@ -25,15 +25,15 @@ for (int mno = 0; mno < this.members.size(); mno++) { String member = getMember(mno); this.account = accounts.getAccount(member); - this.account.updateNotificationsFromMessages(gid, mno, messages, member); + this.account.updateNotificationsFromMessages(member, gid, mno, messages, member); } } public void addGroupMember(String gid, String aid) { this.members.add(aid); } - public Group(List members, List messages, Accounts accounts) { - this.members = members; + public Group(List messages, Accounts accounts, List members) { this.messages = messages; this.accounts = accounts; + this.members = members; } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/GroupChat.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/GroupChat.java index eefc010..6ee5abf 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/GroupChat.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/GroupChat.java @@ -7,11 +7,11 @@ accounts = new Accounts(); groups = new Groups(accounts); } - public List getMembers(String gid) { - return this.groups.getGroup(gid).getMembers(); + public Map getGroup(String gid) { + return this.groups.getGroup(gid).getValue(); } - public void addGroupMember(String gid, String aid) { - this.groups.getGroup(gid).addGroupMember(gid, aid); + public Map getAccount(String v1) { + return this.accounts.getAccount(v1).getValue(); } public List getMessages(String gid) { return this.groups.getGroup(gid).getMessages(); @@ -19,27 +19,27 @@ public void postMessage(String gid, String message) { this.groups.getGroup(gid).postMessage(gid, message); } + public List getMembers(String gid) { + return this.groups.getGroup(gid).getMembers(); + } + public void addGroupMember(String gid, String aid) { + this.groups.getGroup(gid).addGroupMember(gid, aid); + } + public Map getNotifications(String v1) { + return this.accounts.getAccount(v1).getNotifications(); + } + public void hasRead(String aid, String gid) { + this.accounts.getAccount(aid).hasRead(aid, gid); + } + public String getMember(String gid, int mno) { + return this.groups.getGroup(gid).getMember(mno); + } public Map getAccounts() { return this.accounts.getValue(); } public void signUp(String aid) { this.accounts.signUp(aid); } - public Map getNotifications(String aid) { - return this.accounts.getAccount(aid).getNotifications(); - } - public void hasRead(String aid, String gid) { - this.accounts.getAccount(aid).hasRead(aid, gid); - } - public Map getGroup(String gid) { - return this.groups.getGroup(gid).getValue(); - } - public String getMember(String gid, int mno) { - return this.groups.getGroup(gid).getMember(mno); - } - public Map getAccount(String v1) { - return this.accounts.getAccount(v1).getValue(); - } public Map getGroups() { return this.groups.getValue(); } diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Groups.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Groups.java index 3749120..ada656a 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Groups.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PULL-first/Groups.java @@ -10,7 +10,7 @@ return this.value.get(gid); } public void createGroup(String gid) { - this.value.put(gid,new Group(new ArrayList<>(), new ArrayList<>(), accounts)); + this.value.put(gid,new Group(new ArrayList<>(), accounts, new ArrayList<>())); } public Groups(Accounts accounts) { this.accounts = accounts; diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Account.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Account.java index f648219..c4a78ce 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Account.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Account.java @@ -3,9 +3,9 @@ public class Account { private Map notifications; public Map getValue() { - Map temp_nil3 = new HashMap<>(); - temp_nil3.put("notifications",this.getNotifications()); - return temp_nil3; + Map temp_nil19 = new HashMap<>(); + temp_nil19.put("notifications",this.getNotifications()); + return temp_nil19; } public Map getNotifications() { return new HashMap<>(notifications); diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Group.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Group.java index ed8f277..2f3c073 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Group.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Group.java @@ -1,22 +1,22 @@ import java.util.*; public class Group { - private List members; private List messages; private Account account; private Accounts accounts; + private List members; public Map getValue() { - Map temp_nil2 = new HashMap<>(); - temp_nil2.put("members",this.getMembers()); - temp_nil2.put("messages",this.getMessages()); - return temp_nil2; - } - public List getMembers() { - return this.members; + Map temp_nil18 = new HashMap<>(); + temp_nil18.put("members",this.getMembers()); + temp_nil18.put("messages",this.getMessages()); + return temp_nil18; } public List getMessages() { return this.messages; } + public List getMembers() { + return this.members; + } public String getMember(int mno) { return this.members.get(mno); } @@ -25,15 +25,15 @@ for (int mno = 0; mno < this.members.size(); mno++) { String member = getMember(mno); this.account = accounts.getAccount(member); - this.account.updateNotificationsFromMessages(gid, mno, messages, member); + this.account.updateNotificationsFromMessages(member, gid, mno, messages, member); } } public void addGroupMember(String gid, String aid) { this.members.add(aid); } - public Group(List members, List messages, Accounts accounts) { - this.members = members; + public Group(List messages, Accounts accounts, List members) { this.messages = messages; this.accounts = accounts; + this.members = members; } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/GroupChat.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/GroupChat.java index eefc010..6ee5abf 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/GroupChat.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/GroupChat.java @@ -7,11 +7,11 @@ accounts = new Accounts(); groups = new Groups(accounts); } - public List getMembers(String gid) { - return this.groups.getGroup(gid).getMembers(); + public Map getGroup(String gid) { + return this.groups.getGroup(gid).getValue(); } - public void addGroupMember(String gid, String aid) { - this.groups.getGroup(gid).addGroupMember(gid, aid); + public Map getAccount(String v1) { + return this.accounts.getAccount(v1).getValue(); } public List getMessages(String gid) { return this.groups.getGroup(gid).getMessages(); @@ -19,27 +19,27 @@ public void postMessage(String gid, String message) { this.groups.getGroup(gid).postMessage(gid, message); } + public List getMembers(String gid) { + return this.groups.getGroup(gid).getMembers(); + } + public void addGroupMember(String gid, String aid) { + this.groups.getGroup(gid).addGroupMember(gid, aid); + } + public Map getNotifications(String v1) { + return this.accounts.getAccount(v1).getNotifications(); + } + public void hasRead(String aid, String gid) { + this.accounts.getAccount(aid).hasRead(aid, gid); + } + public String getMember(String gid, int mno) { + return this.groups.getGroup(gid).getMember(mno); + } public Map getAccounts() { return this.accounts.getValue(); } public void signUp(String aid) { this.accounts.signUp(aid); } - public Map getNotifications(String aid) { - return this.accounts.getAccount(aid).getNotifications(); - } - public void hasRead(String aid, String gid) { - this.accounts.getAccount(aid).hasRead(aid, gid); - } - public Map getGroup(String gid) { - return this.groups.getGroup(gid).getValue(); - } - public String getMember(String gid, int mno) { - return this.groups.getGroup(gid).getMember(mno); - } - public Map getAccount(String v1) { - return this.accounts.getAccount(v1).getValue(); - } public Map getGroups() { return this.groups.getValue(); } diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Groups.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Groups.java index 3749120..ada656a 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Groups.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/GroupChat/PUSH-first/Groups.java @@ -10,7 +10,7 @@ return this.value.get(gid); } public void createGroup(String gid) { - this.value.put(gid,new Group(new ArrayList<>(), new ArrayList<>(), accounts)); + this.value.put(gid,new Group(new ArrayList<>(), accounts, new ArrayList<>())); } public Groups(Accounts accounts) { this.accounts = accounts; diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Account.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Account.java index ecc737a..26867a3 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Account.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Account.java @@ -1,33 +1,33 @@ import java.util.*; public class Account { - private String name; private int point; + private String name; public Map getValue() { Map temp_nil9 = new HashMap<>(); temp_nil9.put("name",this.getName()); temp_nil9.put("point",this.getPoint()); return temp_nil9; } - public String getName() { - return this.name; - } public int getPoint() { return point; } + public String getName() { + return this.name; + } public void updatePointFromBattle(String self, String rid, int mno, boolean battle, String id) { - int temp_if0; + int temp_if2; if (hasWon) { - temp_if0 = (this.point+1); + temp_if2 = (this.point+1); } else { - temp_if0 = this.point; - }this.point = temp_if0; + temp_if2 = this.point; + }this.point = temp_if2; } public void changeName(String aid, String name) { this.name = name; } - public Account(String name, int point) { - this.name = name; + public Account(int point, String name) { this.point = point; + this.name = name; } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Accounts.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Accounts.java index 6d92c89..b5e61df 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Accounts.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Accounts.java @@ -9,6 +9,6 @@ return this.value.get(mid); } public void signUp(String name, String aid) { - this.value.put(aid,new Account(name, 0)); + this.value.put(aid,new Account(0, name)); } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/OnlineBattleGame2.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/OnlineBattleGame2.java index 69fc17e..16c3526 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/OnlineBattleGame2.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/OnlineBattleGame2.java @@ -7,23 +7,32 @@ accounts = new Accounts(); rooms = new Rooms(accounts); } + public Map getRoom(String rid) { + return this.rooms.getRoom(rid).getValue(); + } + public Map getMember(String rid, int mno) { + return this.rooms.getRoom(rid).getMembers().getMember(mno).getValue(); + } + public int getPoint(String mid) { + return this.accounts.getAccount(mid).getPoint(); + } + public boolean getBattle(String rid) { + return this.rooms.getRoom(rid).getBattle(); + } + public void battle(String rid, boolean hasWon) { + this.rooms.getRoom(rid).battle(rid, hasWon); + } public String getId(String rid, int mno) { return this.rooms.getRoom(rid).getMembers().getMember(mno).getId(); } - public Map getAccount(String mid) { - return this.accounts.getAccount(mid).getValue(); - } public String getName(String mid) { return this.accounts.getAccount(mid).getName(); } public void changeName(String aid, String name) { this.accounts.getAccount(aid).changeName(aid, name); } - public int getPoint(String mid) { - return this.accounts.getAccount(mid).getPoint(); - } - public Map getRoom(String rid) { - return this.rooms.getRoom(rid).getValue(); + public String getName(String rid, int mno) { + return this.rooms.getRoom(rid).getMembers().getMember(mno).getName(); } public List getMembers(String rid) { return this.rooms.getRoom(rid).getMembers().getValue(); @@ -31,18 +40,6 @@ public void addRoomMember(String rid, String id) { this.rooms.getRoom(rid).getMembers().addRoomMember(rid, id); } - public String getName(String rid, int mno) { - return this.rooms.getRoom(rid).getMembers().getMember(mno).getName(); - } - public Map getMember(String rid, int mno) { - return this.rooms.getRoom(rid).getMembers().getMember(mno).getValue(); - } - public boolean getBattle(String rid) { - return this.rooms.getRoom(rid).getBattle(); - } - public void battle(String rid, boolean hasWon) { - this.rooms.getRoom(rid).battle(rid, hasWon); - } public Map getAccounts() { return this.accounts.getValue(); } @@ -55,4 +52,7 @@ public void createRoom(String rid) { this.rooms.createRoom(rid); } + public Map getAccount(String mid) { + return this.accounts.getAccount(mid).getValue(); + } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Room.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Room.java index ff4155c..17dc9db 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Room.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PULL-first/Room.java @@ -7,8 +7,8 @@ private Accounts accounts; public Map getValue() { Map temp_nil8 = new HashMap<>(); - temp_nil8.put("battle",this.getBattle()); temp_nil8.put("members",this.members.getValue()); + temp_nil8.put("battle",this.getBattle()); return temp_nil8; } public Members getMembers() { @@ -22,7 +22,7 @@ for (int mno = 0; mno < this.members.getValue().size(); mno++) { String id = this.members.getMember(mno).getId(); this.account = accounts.getAccount(id); - this.account.updatePointFromBattle(mid, rid, mno, battle, id); + this.account.updatePointFromBattle(id, rid, mno, battle, id); } } public Room(boolean battle, Accounts accounts) { diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Account.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Account.java index 5ad3e48..9b3c0af 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Account.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Account.java @@ -16,12 +16,12 @@ return this.name; } public void updatePointFromBattle(String self, String rid, int mno, boolean battle, String id) { - int temp_if1; + int temp_if3; if (hasWon) { - temp_if1 = (this.point+1); + temp_if3 = (this.point+1); } else { - temp_if1 = this.point; - }this.point = temp_if1; + temp_if3 = this.point; + }this.point = temp_if3; } public void changeName(String aid, String name) { this.name = name; diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Member.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Member.java index 7e548af..b23d481 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Member.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Member.java @@ -1,27 +1,23 @@ import java.util.*; public class Member { + private String id; private Account account; private Accounts accounts; - private String id; public Map getValue() { Map temp_nil13 = new HashMap<>(); temp_nil13.put("id",this.getId()); temp_nil13.put("name",this.getName()); return temp_nil13; } - public String getName() { - return name; - } public String getId() { return this.id; } - public void updateNameFromId(String self, int self2, String rid, int mno, String id) { - this.name = name; - this.id = id; + public String getName() { + return this.account.getName(); } - public Member(Accounts accounts, String id) { - this.accounts = accounts; + public Member(String id, Accounts accounts) { this.id = id; + this.accounts = accounts; } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Members.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Members.java index dd86377..091b561 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Members.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Members.java @@ -9,6 +9,6 @@ return this.value.get(mno); } public void addRoomMember(String rid, String id) { - this.value.add(new Member(accounts, id)); + this.value.add(new Member(id, accounts)); } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/OnlineBattleGame2.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/OnlineBattleGame2.java index a2fbee5..16c3526 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/OnlineBattleGame2.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/OnlineBattleGame2.java @@ -7,23 +7,20 @@ accounts = new Accounts(); rooms = new Rooms(accounts); } - public Map getAccount(String mid) { - return this.accounts.getAccount(mid).getValue(); + public Map getRoom(String rid) { + return this.rooms.getRoom(rid).getValue(); + } + public Map getMember(String rid, int mno) { + return this.rooms.getRoom(rid).getMembers().getMember(mno).getValue(); } public int getPoint(String mid) { return this.accounts.getAccount(mid).getPoint(); } - public Map getRoom(String rid) { - return this.rooms.getRoom(rid).getValue(); + public boolean getBattle(String rid) { + return this.rooms.getRoom(rid).getBattle(); } - public List getMembers(String rid) { - return this.rooms.getRoom(rid).getMembers().getValue(); - } - public void addRoomMember(String rid, String id) { - this.rooms.getRoom(rid).getMembers().addRoomMember(rid, id); - } - public String getName(String rid, int mno) { - return this.rooms.getRoom(rid).getMembers().getMember(mno).getName(); + public void battle(String rid, boolean hasWon) { + this.rooms.getRoom(rid).battle(rid, hasWon); } public String getId(String rid, int mno) { return this.rooms.getRoom(rid).getMembers().getMember(mno).getId(); @@ -34,14 +31,14 @@ public void changeName(String aid, String name) { this.accounts.getAccount(aid).changeName(aid, name); } - public Map getMember(String rid, int mno) { - return this.rooms.getRoom(rid).getMembers().getMember(mno).getValue(); + public String getName(String rid, int mno) { + return this.rooms.getRoom(rid).getMembers().getMember(mno).getName(); } - public boolean getBattle(String rid) { - return this.rooms.getRoom(rid).getBattle(); + public List getMembers(String rid) { + return this.rooms.getRoom(rid).getMembers().getValue(); } - public void battle(String rid, boolean hasWon) { - this.rooms.getRoom(rid).battle(rid, hasWon); + public void addRoomMember(String rid, String id) { + this.rooms.getRoom(rid).getMembers().addRoomMember(rid, id); } public Map getAccounts() { return this.accounts.getValue(); @@ -55,4 +52,7 @@ public void createRoom(String rid) { this.rooms.createRoom(rid); } + public Map getAccount(String mid) { + return this.accounts.getAccount(mid).getValue(); + } } \ No newline at end of file diff --git a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Room.java b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Room.java index ccc1b77..85b976f 100644 --- a/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Room.java +++ b/AlgebraicDataflowArchitectureModel/prototypes/Java/OnlineBattleGame2/PUSH-first/Room.java @@ -7,8 +7,8 @@ private Accounts accounts; public Map getValue() { Map temp_nil11 = new HashMap<>(); - temp_nil11.put("battle",this.getBattle()); temp_nil11.put("members",this.members.getValue()); + temp_nil11.put("battle",this.getBattle()); return temp_nil11; } public Members getMembers() { @@ -22,7 +22,7 @@ for (int mno = 0; mno < this.members.getValue().size(); mno++) { String id = this.members.getMember(mno).getId(); this.account = accounts.getAccount(id); - this.account.updatePointFromBattle(mid, rid, mno, battle, id); + this.account.updatePointFromBattle(id, rid, mno, battle, id); } } public Room(boolean battle, Accounts accounts) { diff --git a/AlgebraicDataflowArchitectureModel/src/generators/CodeGeneratorFromDataFlowGraph.java b/AlgebraicDataflowArchitectureModel/src/generators/CodeGeneratorFromDataFlowGraph.java index 2ae5b8f..dc818eb 100644 --- a/AlgebraicDataflowArchitectureModel/src/generators/CodeGeneratorFromDataFlowGraph.java +++ b/AlgebraicDataflowArchitectureModel/src/generators/CodeGeneratorFromDataFlowGraph.java @@ -1912,13 +1912,18 @@ refVarName))); } } - // Update fields to refer to outside resources. + List>> pathParams = new ArrayList<>(); if (platformSpec.isMonolithic()) { + // Update fields to refer to outside resources. + ResourcePath filledOutsideResourcePath = null; try { Map>> resourcePaths = ch2.fillOutsideResourcePaths(out1, getPullAccessor(platformSpec)); if (resourcePaths != null && resourcePaths.size() > 0) { for (ChannelMember outsideMember: resourcePaths.keySet()) { ResourcePath outsidePath = resourcePaths.get(outsideMember).getKey(); + if (out1.equals(outsideMember)) { + filledOutsideResourcePath = outsidePath; + } if (!generatesComponent(outsidePath.getResourceHierarchy())) { outsidePath = outsidePath.getParent(); } @@ -1946,15 +1951,32 @@ | InvalidMessage | UnificationFailed | ValueUndefined e) { e.printStackTrace(); } - } - // Values of path parameters to call the update method. - List>> pathParams = new ArrayList<>(); - for (Expression pathParam: out1.getResource().getPathParams()) { - if (pathParam instanceof Variable) { - Variable pathVar = (Variable) pathParam; - pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), - new AbstractMap.SimpleEntry<>(pathVar.getName(), - pathVar.getName()))); + // Values of path parameters to call the update method. + if (filledOutsideResourcePath == null) { + filledOutsideResourcePath = out1.getResource(); + } + for (Expression pathParam: filledOutsideResourcePath.getPathParams()) { + if (pathParam instanceof Variable) { + Variable pathVar = (Variable) pathParam; + pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), + new AbstractMap.SimpleEntry<>(pathVar.getName(), + pathVar.getName()))); + } else if (pathParam instanceof Constant) { + Constant pathVar = (Constant) pathParam; + pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), + new AbstractMap.SimpleEntry<>(pathVar.getSymbol().getName(), + pathVar.getSymbol().getName()))); + } + } + } else { + // Values of path parameters to call the update method. + for (Expression pathParam: out1.getResource().getPathParams()) { + if (pathParam instanceof Variable) { + Variable pathVar = (Variable) pathParam; + pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), + new AbstractMap.SimpleEntry<>(pathVar.getName(), + pathVar.getName()))); + } } } // Values of channel parameters to call the update method. @@ -2797,13 +2819,18 @@ refVarName))); } } - // Update fields to refer to outside resources. + List>> pathParams = new ArrayList<>(); if (platformSpec.isMonolithic()) { + // Update fields to refer to outside resources. + ResourcePath filledOutsideResourcePath = null; try { Map>> resourcePaths = ch2.fillOutsideResourcePaths(out2, getPullAccessor(platformSpec)); if (resourcePaths != null && resourcePaths.size() > 0) { for (ChannelMember outsideMember: resourcePaths.keySet()) { ResourcePath outsidePath = resourcePaths.get(outsideMember).getKey(); + if (out2.equals(outsideMember)) { + filledOutsideResourcePath = outsidePath; + } if (!generatesComponent(outsidePath.getResourceHierarchy())) { outsidePath = outsidePath.getParent(); } @@ -2831,15 +2858,32 @@ | InvalidMessage | UnificationFailed | ValueUndefined e) { e.printStackTrace(); } - } - // Values of path parameters to call the update method. - List>> pathParams = new ArrayList<>(); - for (Expression pathParam: out2.getResource().getPathParams()) { - if (pathParam instanceof Variable) { - Variable pathVar = (Variable) pathParam; - pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), - new AbstractMap.SimpleEntry<>(pathVar.getName(), - pathVar.getName()))); + // Values of path parameters to call the update method. + if (filledOutsideResourcePath == null) { + filledOutsideResourcePath = out2.getResource(); + } + for (Expression pathParam: filledOutsideResourcePath.getPathParams()) { + if (pathParam instanceof Variable) { + Variable pathVar = (Variable) pathParam; + pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), + new AbstractMap.SimpleEntry<>(pathVar.getName(), + pathVar.getName()))); + } else if (pathParam instanceof Constant) { + Constant pathVar = (Constant) pathParam; + pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), + new AbstractMap.SimpleEntry<>(pathVar.getSymbol().getName(), + pathVar.getSymbol().getName()))); + } + } + } else { + // Values of path parameters to call the update method. + for (Expression pathParam: out2.getResource().getPathParams()) { + if (pathParam instanceof Variable) { + Variable pathVar = (Variable) pathParam; + pathParams.add(new AbstractMap.SimpleEntry<>(pathVar.getType(), + new AbstractMap.SimpleEntry<>(pathVar.getName(), + pathVar.getName()))); + } } } // Values of channel parameters to call the update method. diff --git a/AlgebraicDataflowArchitectureModel/src/generators/JavaMethodBodyGenerator.java b/AlgebraicDataflowArchitectureModel/src/generators/JavaMethodBodyGenerator.java index 73bc20b..91cecdd 100644 --- a/AlgebraicDataflowArchitectureModel/src/generators/JavaMethodBodyGenerator.java +++ b/AlgebraicDataflowArchitectureModel/src/generators/JavaMethodBodyGenerator.java @@ -366,10 +366,14 @@ } } // Update fields to refer to outside resources. + ResourcePath filledOutsideResourcePath = null; Map>> resourcePaths = ch.fillOutsideResourcePaths(out, JavaCodeGenerator.pullAccessor); if (resourcePaths != null && resourcePaths.size() > 0) { for (ChannelMember outsideMember: resourcePaths.keySet()) { ResourcePath outsidePath = resourcePaths.get(outsideMember).getKey(); + if (out.equals(outsideMember)) { + filledOutsideResourcePath = outsidePath; + } if (!JavaCodeGenerator.generatesComponent(outsidePath.getResourceHierarchy())) { outsidePath = outsidePath.getParent(); } @@ -394,11 +398,17 @@ } } // Values of path parameters to call the update method. + if (filledOutsideResourcePath == null) { + filledOutsideResourcePath = dstRes; + } String pathParams = ""; - for (Expression pathParam: dstRes.getPathParams()) { + for (Expression pathParam: filledOutsideResourcePath.getPathParams()) { if (pathParam instanceof Variable) { Variable pathVar = (Variable) pathParam; pathParams += pathVar.getName() + ", "; + } else if (pathParam instanceof Constant) { + Constant pathVar = (Constant) pathParam; + pathParams += pathVar.getSymbol().getName() + ", "; } } // Values of channel parameters to call the update method. @@ -517,10 +527,14 @@ } } // Update fields to refer to outside resources. + ResourcePath filledOutsideResourcePath = null; Map>> resourcePaths = ch.fillOutsideResourcePaths(out, JavaCodeGenerator.pullAccessor); if (resourcePaths != null && resourcePaths.size() > 0) { for (ChannelMember outsideMember: resourcePaths.keySet()) { ResourcePath outsidePath = resourcePaths.get(outsideMember).getKey(); + if (out.equals(outsideMember)) { + filledOutsideResourcePath = outsidePath; + } if (!JavaCodeGenerator.generatesComponent(outsidePath.getResourceHierarchy())) { outsidePath = outsidePath.getParent(); } @@ -545,11 +559,17 @@ } } // Values of path parameters to call the update method. + if (filledOutsideResourcePath == null) { + filledOutsideResourcePath = dstRes; + } String pathParams = ""; - for (Expression pathParam: dstRes.getPathParams()) { + for (Expression pathParam: filledOutsideResourcePath.getPathParams()) { if (pathParam instanceof Variable) { Variable pathVar = (Variable) pathParam; pathParams += pathVar.getName() + ", "; + } else if (pathParam instanceof Constant) { + Constant pathVar = (Constant) pathParam; + pathParams += pathVar.getSymbol().getName() + ", "; } } // Values of channel parameters to call the update method.