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

org.nutz.el.opt.object.FetchArrayOpt Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
package org.nutz.el.opt.object;

import java.util.Queue;

import org.nutz.el.opt.AbstractOpt;

/**
 * ']',数组封装.
 * 本身没做什么操作,只是对'[' ArrayOpt 做了一个封装而已
 * @author juqkai([email protected])
 *
 */
public class FetchArrayOpt extends AbstractOpt {
	private Object left;
	public void wrap(Queue operand) {
		left = operand.poll();
	}
	public int fetchPriority() {
		return 1;
	}
	public Object calculate() {
		if(left instanceof ArrayOpt){
			return ((ArrayOpt) left).calculate();
		}
		return null;
	}
	public String fetchSelf() {
		return "]";
	}
}