当前位置: 首页>>代码示例>>Java>>正文


Java BitWiseOpEnum类代码示例

本文整理汇总了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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:ExprBitWiseNode.java

示例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());
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:18,代码来源:TestExprBitWiseNode.java

示例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());
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:22,代码来源:TestExprBitWiseNode.java

示例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));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:TestExprBitWiseNode.java

示例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)));
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:8,代码来源:TestExprBitWiseNode.java

示例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());
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:TestExprBitWiseNode.java

示例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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:6,代码来源:ExprBitWiseNodeForge.java

示例8: getComputer

import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public BitWiseOpEnum.Computer getComputer() {
    return computer;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:ExprBitWiseNodeForge.java

示例9: setUp

import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
public void setUp() {
    _bitWiseNode = new ExprBitWiseNode(BitWiseOpEnum.BAND);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:4,代码来源:TestExprBitWiseNode.java

示例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));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:7,代码来源:TestExprBitWiseNode.java

示例11: ExprBitWiseNode

import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
 * Ctor.
 * @param bitWiseOpEnum_ - type of math
 */
public ExprBitWiseNode(BitWiseOpEnum bitWiseOpEnum_)
{
    _bitWiseOpEnum = bitWiseOpEnum_;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:ExprBitWiseNode.java

示例12: getBitWiseOpEnum

import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
 * Returns the bitwise operator.
 * @return operator
 */
public BitWiseOpEnum getBitWiseOpEnum()
{
    return _bitWiseOpEnum;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:ExprBitWiseNode.java

示例13: getBinaryOp

import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
 * Returns the binary operator.
 * @return operator
 */
public BitWiseOpEnum getBinaryOp()
{
    return binaryOp;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:BitwiseOpExpression.java

示例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;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:BitwiseOpExpression.java

示例15: binaryAnd

import com.espertech.esper.type.BitWiseOpEnum; //导入依赖的package包/类
/**
 * Bitwise (binary) AND.
 * @return expression
 */
public static BitwiseOpExpression binaryAnd()
{
    return new BitwiseOpExpression(BitWiseOpEnum.BAND);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:9,代码来源:Expressions.java


注:本文中的com.espertech.esper.type.BitWiseOpEnum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。