Mercurial > hg > Database > Alice
changeset 481:549cc29aca59 dispose
change access type private
author | sugi |
---|---|
date | Fri, 05 Dec 2014 17:22:11 +0900 |
parents | c06070403ed4 |
children | 8227a2fd5a55 |
files | src/main/java/alice/codesegment/CodeSegment.java src/main/java/alice/codesegment/InputDataSegment.java |
diffstat | 2 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/codesegment/CodeSegment.java Fri Dec 05 03:19:25 2014 +0900 +++ b/src/main/java/alice/codesegment/CodeSegment.java Fri Dec 05 17:22:11 2014 +0900 @@ -9,12 +9,16 @@ public InputDataSegment ids = new InputDataSegment(this); public OutputDataSegment ods = new OutputDataSegment(); - public ArrayList<Receiver> list = new ArrayList<Receiver>(); + private ArrayList<Receiver> list = new ArrayList<Receiver>(); public void execute() { ids.receive(); } + public void register(Receiver receiver) { + list.add(receiver); + } + public void recycle(){ ids.init(); ids.setCounter(list.size());
--- a/src/main/java/alice/codesegment/InputDataSegment.java Fri Dec 05 03:19:25 2014 +0900 +++ b/src/main/java/alice/codesegment/InputDataSegment.java Fri Dec 05 17:22:11 2014 +0900 @@ -29,7 +29,7 @@ } public void quickPeek(Receiver receiver) { - cs.list.add(receiver); + cs.register(receiver); if (receiver.managerKey==null){ DataSegment.getLocal().peek(receiver, cs, null); } else { @@ -42,7 +42,7 @@ public void peek(Receiver receiver) { - cs.list.add(receiver); + cs.register(receiver); if (receiver.managerKey==null){ DataSegment.getLocal().peek(receiver, cs, null); } else { @@ -54,7 +54,7 @@ } public void quickTake(Receiver receiver) { - cs.list.add(receiver); + cs.register(receiver); if (receiver.managerKey==null){ DataSegment.getLocal().take(receiver, cs, null); } else { @@ -66,7 +66,7 @@ } public void take(Receiver receiver) { - cs.list.add(receiver); + cs.register(receiver); if (receiver.managerKey==null){ DataSegment.getLocal().take(receiver, cs, null); } else {