All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.logicbus.kvalue.xscript.zset.KVZCard Maven / Gradle / Ivy

There is a newer version: 1.6.17
Show newest version
package com.logicbus.kvalue.xscript.zset;

import java.util.Map;

import com.alogic.xscript.ExecuteWatcher;
import com.alogic.xscript.Logiclet;
import com.alogic.xscript.LogicletContext;
import com.logicbus.kvalue.xscript.KVRowOperation;
import com.anysoft.util.Properties;
import com.logicbus.kvalue.core.KeyValueRow;
import com.logicbus.kvalue.core.SortedSetRow;

/**获取有序集合的成员数
 *
 * @author zhongyi
 *
 */
public class KVZCard extends KVRowOperation {

	

	public KVZCard(String tag, Logiclet p) {
		super(tag, p);
	}

	@Override
	public void configure(Properties p) {
		super.configure(p);
	}

	@Override
	protected void onExecute(KeyValueRow row, Map root, Map current,
			LogicletContext ctx, ExecuteWatcher watcher) {

		if (row instanceof SortedSetRow) {
			SortedSetRow r = (SortedSetRow) row;
			ctx.SetValue(id,
					String.valueOf(r.size()));
		}

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy