@Test public void testNotExpression() { try { notExpr = new NotExpression(null); Assert.fail(); } catch (StreamingException e) { Assert.assertTrue(true); } try { notExpr = new NotExpression(new ConstExpression(SupportConst.I_TWO)); Assert.fail(); } catch (StreamingException e) { Assert.assertTrue(true); } }
public NotExpression(IExpression innerExpr) throws StreamingException { if (innerExpr == null) { LOG.error("Arguments in '{}' operator is null.", this.getClass().getName()); StreamingException exception = new StreamingException(ErrorCode.UNKNOWN_SERVER_COMMON_ERROR); throw exception; } Class< ? > childType = innerExpr.getType(); if (!StreamClassUtil.isBoolean(childType)) { StreamingException exception = new StreamingException(ErrorCode.SEMANTICANALYZE_NOT_EXPRESSION_BOOLEAN_TYPE); LOG.error(exception.getMessage(), exception); throw exception; } this.innerExpr = innerExpr; }
NotExpression implements IBooleanExpression { public NotExpression(IExpression innerExpr) throws StreamingException { if (innerExpr == null) { LOG.error("Arguments in '{}' operator is null.", this.getClass().getName()); StreamingException exception = new StreamingException(ErrorCode.UNKNOWN_SERVER_COMMON_ERROR); throw exception; } Class< ? > childType = innerExpr.getType(); if (!StreamClassUtil.isBoolean(childType)) { StreamingException exception = new StreamingException(ErrorCode.SEMANTICANALYZE_NOT_EXPRESSION_BOOLEAN_TYPE); LOG.error(exception.getMessage(), exception); throw exception; } this.innerExpr = innerExpr; } }
NotExpression implements IBooleanExpression { public NotExpression(IExpression innerExpr) throws StreamingException { if (innerExpr == null) { LOG.error("Arguments in '{}' operator is null.", this.getClass().getName()); StreamingException exception = new StreamingException(ErrorCode.UNKNOWN_SERVER_COMMON_ERROR); throw exception; } Class< ? > childType = innerExpr.getType(); if (!StreamClassUtil.isBoolean(childType)) { StreamingException exception = new StreamingException(ErrorCode.SEMANTICANALYZE_NOT_EXPRESSION_BOOLEAN_TYPE); LOG.error(exception.getMessage(), exception); throw exception; } this.innerExpr = innerExpr; } NotExpression(IExpression innerExpr); }
NotExpression implements IBooleanExpression { public NotExpression(IExpression innerExpr) throws StreamingException { if (innerExpr == null) { LOG.error("Arguments in '{}' operator is null.", this.getClass().getName()); StreamingException exception = new StreamingException(ErrorCode.UNKNOWN_SERVER_COMMON_ERROR); throw exception; } Class< ? > childType = innerExpr.getType(); if (!StreamClassUtil.isBoolean(childType)) { StreamingException exception = new StreamingException(ErrorCode.SEMANTICANALYZE_NOT_EXPRESSION_BOOLEAN_TYPE); LOG.error(exception.getMessage(), exception); throw exception; } this.innerExpr = innerExpr; } NotExpression(IExpression innerExpr); @Override Object evaluate(IEvent theEvent); @Override Object evaluate(IEvent[] eventsPerStream); @Override Class< ? > getType(); IExpression getInnerExpr(); }
NotExpression implements IBooleanExpression { public NotExpression(IExpression innerExpr) throws StreamingException { if (innerExpr == null) { LOG.error("Arguments in '{}' operator is null.", this.getClass().getName()); StreamingException exception = new StreamingException(ErrorCode.UNKNOWN_SERVER_COMMON_ERROR); throw exception; } Class< ? > childType = innerExpr.getType(); if (!StreamClassUtil.isBoolean(childType)) { StreamingException exception = new StreamingException(ErrorCode.SEMANTICANALYZE_NOT_EXPRESSION_BOOLEAN_TYPE); LOG.error(exception.getMessage(), exception); throw exception; } this.innerExpr = innerExpr; } NotExpression(IExpression innerExpr); @Override Object evaluate(IEvent theEvent); @Override Object evaluate(IEvent[] eventsPerStream); @Override Class< ? > getType(); IExpression getInnerExpr();  }