Mercurial > hg > Members > nobuyasu > jungle-network
view src/main/java/alice/jungle/operations/NetworkDeleteAttributeOperation.java @ 195:82698be06c6c default tip
change index TreeMap
author | tatsuki |
---|---|
date | Tue, 28 Apr 2015 07:51:41 +0900 |
parents | 89c15aa2bc6d |
children |
line wrap: on
line source
package alice.jungle.operations; import java.nio.ByteBuffer; import org.msgpack.annotation.Message; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; @Message public class NetworkDeleteAttributeOperation implements NodeOperation { /* MessagePack cannot handle final.*/ //private final String key; private String key; public NetworkDeleteAttributeOperation() { key = null; } public NetworkDeleteAttributeOperation(String _key) { key = _key; } @Override public Command getCommand() { return Command.DELETE_ATTRIBUTE; } @Override public Either<Error, TreeNode> invoke(TreeNode _target) { return _target.getAttributes().delete(key); } @Override public int getPosition() { return -1; } @Override public String getKey() { return key; } @Override public ByteBuffer getValue() { return null; } }