view src/alice/datasegment/DataSegmentReceiver.java @ 28:98ab26e09a98

Configuration Manager work and implements reverseKey
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Tue, 17 Jan 2012 08:41:34 +0900
parents e7867328a2fb
children b5a21baf0b07
line wrap: on
line source

package alice.datasegment;

import org.msgpack.type.Value;

import alice.codesegment.InputDataSegment;

public class DataSegmentReceiver {
	public InputDataSegment ids;
	public int index;
	public Value val;
	public String from;
	public CommandType type;
	
	
	public DataSegmentReceiver(InputDataSegment ids, CommandType type) {
		this.ids = ids;
		this.type = type;
		ids.regist();
	}
	
	public void setKey(String managerKey, String key) {
		setKey(managerKey, key, 0);
	}

	public void setKey(String managerKey, String key, int index) {
		switch (type) {
		case PEEK:
			ids.peek(this, managerKey, key, index);
			break;
		case TAKE:
			ids.take(this, managerKey, key, index);
			break;
		}
		ids.setKey();
	}
	
}