diff src/main/java/alice/codesegment/InputDataSegment.java @ 455:b004f62b83e5 dispose

refactor (remove quick method from DataSegmentManager and use flag)
author sugi
date Sun, 02 Nov 2014 18:07:43 +0900
parents f68d103498e0
children bcf6f4a6fcd0
line wrap: on
line diff
--- a/src/main/java/alice/codesegment/InputDataSegment.java	Tue Oct 28 17:34:26 2014 +0900
+++ b/src/main/java/alice/codesegment/InputDataSegment.java	Sun Nov 02 18:07:43 2014 +0900
@@ -7,6 +7,7 @@
 import alice.datasegment.DataSegment;
 import alice.datasegment.ReceiveData;
 import alice.datasegment.Receiver;
+import alice.datasegment.SendOption;
 
 /**
  * InputDataSegment Manager
@@ -31,37 +32,41 @@
     public void quickPeek(Receiver receiver) {
         cs.list.add(receiver);
         if (receiver.managerKey==null){
-            DataSegment.getLocal().peek(receiver, cs);
+            DataSegment.getLocal().peek(receiver, cs, null);
         } else {
-            DataSegment.get(receiver.managerKey).quickPeek(receiver ,cs);
+            SendOption option = new SendOption(true, false);
+            DataSegment.get(receiver.managerKey).peek(receiver, cs, option);
+        }
+    }
+
+
+    public void peek(Receiver receiver) {
+        cs.list.add(receiver);
+        if (receiver.managerKey==null){
+            DataSegment.getLocal().peek(receiver, cs, null);
+        } else {
+            SendOption option = new SendOption(false, false);
+            DataSegment.get(receiver.managerKey).peek(receiver, cs, option);
         }
     }
 
     public void quickTake(Receiver receiver) {
         cs.list.add(receiver);
         if (receiver.managerKey==null){
-            DataSegment.getLocal().quickTake(receiver, cs);
+            DataSegment.getLocal().take(receiver, cs, null);
         } else {
-            DataSegment.get(receiver.managerKey).quickTake(receiver ,cs);
+            SendOption option = new SendOption(true, false);
+            DataSegment.get(receiver.managerKey).take(receiver, cs, option);
         }
     }
 
-    public void peek(Receiver receiver) {
-        cs.list.add(receiver);
-        if (receiver.managerKey==null){
-            DataSegment.getLocal().peek(receiver, cs);
-        } else {
-            DataSegment.get(receiver.managerKey).peek(receiver, cs);
-        }
-    }
-
-
     public void take(Receiver receiver) {
         cs.list.add(receiver);
         if (receiver.managerKey==null){
-            DataSegment.getLocal().take(receiver, cs);
+            DataSegment.getLocal().take(receiver, cs, null);
         } else {
-            DataSegment.get(receiver.managerKey).take(receiver, cs);
+            SendOption option = new SendOption(false, false);
+            DataSegment.get(receiver.managerKey).take(receiver, cs, option);
         }
     }