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

panda.el.opt.bit.BitXor Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.el.opt.bit;

import panda.el.ELContext;
import panda.el.opt.AbstractTwoOpt;

/**
 * XOR: ^
 */
public class BitXor extends AbstractTwoOpt {
	public int getPriority() {
		return 9;
	}

	public Object calculate(ELContext ec) {
		Integer lval = (Integer)getLeft(ec);
		Integer rval = (Integer)getRight(ec);
		if (isReturnNull(ec, lval, rval)) {
			return null;
		}
		return lval ^ rval;
	}

	public String operator() {
		return "^";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy