本文整理汇总了Java中com.espertech.esper.type.BitWiseOpEnum类的典型用法代码示例。如果您正苦于以下问题:Java BitWiseOpEnum类的具体用法?Java BitWiseOpEnum怎么用?Java BitWiseOpEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BitWiseOpEnum类属于com.espertech.esper.type包,在下文中一共展示了BitWiseOpEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public ExprNode validate(ExprValidationContext validationContext) throws ExprValidationException {
if (this.getChildNodes().length != 2) {
throw new ExprValidationException("BitWise node must have 2 parameters");
}
Class typeOne = JavaClassHelper.getBoxedType(getChildNodes()[0].getForge().getEvaluationType());
Class typeTwo = JavaClassHelper.getBoxedType(getChildNodes()[0].getForge().getEvaluationType());
checkNumericOrBoolean(typeOne);
checkNumericOrBoolean(typeTwo);
if ((JavaClassHelper.isFloatingPointClass(typeOne)) || (JavaClassHelper.isFloatingPointClass(typeTwo))) {
throw new ExprValidationException("Invalid type for bitwise " + bitWiseOpEnum.getComputeDescription() + " operator");
}
if (typeOne != typeTwo) {
throw new ExprValidationException("Bitwise expressions must be of the same type for bitwise " + bitWiseOpEnum.getComputeDescription() + " operator");
}
BitWiseOpEnum.Computer computer = bitWiseOpEnum.getComputer(typeOne);
forge = new ExprBitWiseNodeForge(this, typeOne, computer);
return null;
}
示例2: testGetType
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void testGetType() throws Exception {
log.debug(".testGetType");
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
_bitWiseNode.addChildNode(new SupportExprNode(Double.class));
_bitWiseNode.addChildNode(new SupportExprNode(Integer.class));
try {
_bitWiseNode.validate(SupportExprValidationContextFactory.makeEmpty());
fail();
} catch (ExprValidationException ex) {
// Expected
}
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
_bitWiseNode.addChildNode(new SupportExprNode(Long.class));
_bitWiseNode.addChildNode(new SupportExprNode(Long.class));
ExprNodeUtilityRich.getValidatedSubtree(ExprNodeOrigin.SELECT, _bitWiseNode, SupportExprValidationContextFactory.makeEmpty());
assertEquals(Long.class, _bitWiseNode.getForge().getEvaluationType());
}
示例3: testGetType
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void testGetType() throws Exception
{
log.debug(".testGetType");
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
_bitWiseNode.addChildNode(new SupportExprNode(Double.class));
_bitWiseNode.addChildNode(new SupportExprNode(Integer.class));
try
{
_bitWiseNode.validate(ExprValidationContextFactory.makeEmpty());
fail();
}
catch (ExprValidationException ex)
{
// Expected
}
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
_bitWiseNode.addChildNode(new SupportExprNode(Long.class));
_bitWiseNode.addChildNode(new SupportExprNode(Long.class));
ExprNodeUtility.getValidatedSubtree(_bitWiseNode, ExprValidationContextFactory.makeEmpty());
assertEquals(Long.class, _bitWiseNode.getType());
}
示例4: testToExpressionString
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void testToExpressionString() throws Exception {
log.debug(".testToExpressionString");
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
_bitWiseNode.addChildNode(new SupportExprNode(4));
_bitWiseNode.addChildNode(new SupportExprNode(2));
assertEquals("4&2", ExprNodeUtilityCore.toExpressionStringMinPrecedenceSafe(_bitWiseNode));
}
示例5: testEqualsNode
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void testEqualsNode() throws Exception
{
log.debug(".testEqualsNode");
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
assertTrue(_bitWiseNode.equalsNode(_bitWiseNode));
assertFalse(_bitWiseNode.equalsNode(new ExprBitWiseNode(BitWiseOpEnum.BXOR)));
}
示例6: testToExpressionString
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void testToExpressionString() throws Exception
{
log.debug(".testToExpressionString");
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
_bitWiseNode.addChildNode(new SupportExprNode(4));
_bitWiseNode.addChildNode(new SupportExprNode(2));
assertEquals("(4&2)", _bitWiseNode.toExpressionString());
}
示例7: ExprBitWiseNodeForge
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public ExprBitWiseNodeForge(ExprBitWiseNode parent, Class resultType, BitWiseOpEnum.Computer computer) {
this.parent = parent;
this.resultType = resultType;
this.computer = computer;
}
示例8: getComputer
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public BitWiseOpEnum.Computer getComputer() {
return computer;
}
示例9: setUp
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void setUp() {
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
}
示例10: testEqualsNode
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void testEqualsNode() throws Exception {
log.debug(".testEqualsNode");
_bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
assertTrue(_bitWiseNode.equalsNode(_bitWiseNode, false));
assertFalse(_bitWiseNode.equalsNode(new ExprBitWiseNode(BitWiseOpEnum.BXOR), false));
}
示例11: ExprBitWiseNode
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
* Ctor.
* @param bitWiseOpEnum_ - type of math
*/
public ExprBitWiseNode(BitWiseOpEnum bitWiseOpEnum_)
{
_bitWiseOpEnum = bitWiseOpEnum_;
}
示例12: getBitWiseOpEnum
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
* Returns the bitwise operator.
* @return operator
*/
public BitWiseOpEnum getBitWiseOpEnum()
{
return _bitWiseOpEnum;
}
示例13: getBinaryOp
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
* Returns the binary operator.
* @return operator
*/
public BitWiseOpEnum getBinaryOp()
{
return binaryOp;
}
示例14: setBinaryOp
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
* Sets the binary operator.
* @param binaryOp operator to set
*/
public void setBinaryOp(BitWiseOpEnum binaryOp)
{
this.binaryOp = binaryOp;
}
示例15: binaryAnd
import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
* Bitwise (binary) AND.
* @return expression
*/
public static BitwiseOpExpression binaryAnd()
{
return new BitwiseOpExpression(BitWiseOpEnum.BAND);
}