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

org.nutz.el.opt.logic.OrOpt2 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.logic;

import org.nutz.el.opt.TwoTernary;
import org.nutz.lang.Lang;

/**
 * A ||| B 如果A是null, 或者A是数组/集合/Map但长度是0,返回B
 * 
 * @author wendal([email protected])
 *
 */
public class OrOpt2 extends TwoTernary {

    public int fetchPriority() {
        return 12;
    }

    public Object calculate() {
        Object lval = calculateItem(left);
        if (Lang.eleSize(lval) > 0) {
            return lval;
        }
        return calculateItem(right);
    }

    public String fetchSelf() {
        return "|||";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy