view src/main/java/alice/jungle/operations/NetworkAppendChildAtOperation.java @ 176:6f104ab4eb81

fit jungle core but editMessage is not work
author tatsuki
date Mon, 01 Sep 2014 00:04:32 +0900
parents f9e29a52efd3
children 2828205bdc3a
line wrap: on
line source

package alice.jungle.operations;

import java.nio.ByteBuffer;

import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation;

import org.msgpack.annotation.Message;


@Message
public class NetworkAppendChildAtOperation implements NodeOperation {
	
	/* MessagePack cannot handle final.*/
	//	private final int pos;
	private int pos;
	
	/* Position -1 represent root position. */
	public NetworkAppendChildAtOperation() { pos = -2; }
	
	public NetworkAppendChildAtOperation(int _pos) {
		pos = _pos;
	}
	
	@Override
	public Command getCommand() {
		return Command.APPEND_CHILD;
	}
	
	/*@Override
	public <T extends TreeNode> Either<Error, TreeNode> invoke(TreeNode _target) {
		NetworkAppendChildAt appendChildAt = new NetworkAppendChildAt(pos);
		return appendChildAt.edit(_target);
	}*/

	@Override
	public int getPosition() {
		return pos;
	}

	@Override
	public String getKey() {
		return null;
	}

	@Override
	public ByteBuffer getValue() {
		return null;
	}
}