gt:         countNode.addChildNode(new SupportExprNode(value, type));
context: /*
   * *************************************************************************************
   *  Copyright (C) 2006-2015 EsperTech, Inc. All rights reserved.                       *
   *  http://www.espertech.com/esper                                                     *
   *  http://www.espertech.com                                                           *
   *  ---------------------------------------------------------------------------------- *
   *  The software in this package is published under the terms of the GPL license       *
   *  a copy of which has been included with this distribution in the license.txt file.  *
   * *************************************************************************************
   */
  
  package com.espertech.esper.support.epl;
  
  import com.espertech.esper.client.EventType;
  import com.espertech.esper.epl.core.*;
  import com.espertech.esper.epl.expression.*;
  import com.espertech.esper.epl.expression.baseagg.ExprAggregateNode;
  import com.espertech.esper.epl.expression.core.*;
  import com.espertech.esper.epl.expression.funcs.ExprCaseNode;
  import com.espertech.esper.epl.expression.methodagg.ExprCountNode;
  import com.espertech.esper.epl.expression.methodagg.ExprSumNode;
  import com.espertech.esper.epl.expression.ops.*;
  import com.espertech.esper.epl.expression.prev.ExprPreviousNode;
  import com.espertech.esper.epl.expression.prev.ExprPreviousNodePreviousType;
  import com.espertech.esper.epl.expression.prior.ExprPriorNode;
  import com.espertech.esper.epl.join.plan.*;
  import com.espertech.esper.epl.variable.VariableService;
  import com.espertech.esper.epl.variable.VariableServiceImpl;
  import com.espertech.esper.schedule.SchedulingServiceImpl;
  import com.espertech.esper.support.bean.SupportBean;
  import com.espertech.esper.support.bean.SupportMarketDataBean;
  import com.espertech.esper.support.core.SupportEngineImportServiceFactory;
  import com.espertech.esper.support.core.SupportExprEvaluatorContext;
  import com.espertech.esper.support.event.SupportEventAdapterService;
  import com.espertech.esper.support.event.SupportEventTypeFactory;
  import com.espertech.esper.timer.TimeSourceServiceImpl;
  import com.espertech.esper.type.MathArithTypeEnum;
  import com.espertech.esper.type.RelationalOpEnum;
  import com.espertech.esper.view.ViewFactory;
  import com.espertech.esper.view.ViewFactoryChain;
  import com.espertech.esper.view.window.LengthWindowViewFactory;
  
  import java.util.LinkedList;
  import java.util.List;
  
  public class SupportExprNodeFactory
  {
      public static QueryGraphValueEntryHashKeyed makeKeyed(String property) {
          return new QueryGraphValueEntryHashKeyedExpr(new ExprIdentNodeImpl(property), false);
      }
  
      public static QueryGraphValueEntryRange makeRangeLess(String prop) {
          return new QueryGraphValueEntryRangeRelOp(QueryGraphRangeEnum.LESS, new ExprIdentNodeImpl(prop), false);
      }
  
      public static QueryGraphValueEntryRange makeRangeIn(String start, String end) {
          return new QueryGraphValueEntryRangeIn(QueryGraphRangeEnum.RANGE_OPEN, new ExprIdentNodeImpl(start), new ExprIdentNodeImpl(end), false);
      }
  
      public static ExprNode[] makeIdentExprNodes(String ... props) {
          ExprNode[] nodes = new ExprNode[props.length];
          for (int i = 0; i < props.length; i++) {
              nodes[i] = new ExprIdentNodeImpl(props[i]);
          }
          return nodes;
      }
  
      public static ExprNode[] makeConstAndIdentNode(String constant, String property) {
          return new ExprNode[] {new ExprConstantNodeImpl(constant), new ExprIdentNodeImpl(property)};
      }
  
      public static ExprNode[] makeConstAndConstNode(String constantOne, String constantTwo) {
          return new ExprNode[] {new ExprConstantNodeImpl(constantOne), new ExprConstantNodeImpl(constantTwo)};
      }
  
      public static ExprNode makeIdentExprNode(String property) {
          return new ExprIdentNodeImpl(property);
      }
  
      public static ExprNode makeConstExprNode(String constant) {
          return new ExprConstantNodeImpl(constant);
      }
  
      public static ExprNode[] makeIdentNodesBean(String ... names) throws Exception
      {
          ExprNode[] nodes = new ExprNode[names.length];
          for (int i = 0; i < names.length; i++)
          {
              nodes[i] = new ExprIdentNodeImpl(names[i]);
              validate1StreamBean(nodes[i]);
          }
          return nodes;
      }
  
      public static ExprNode[] makeIdentNodesMD(String ... names) throws Exception
      {
          ExprNode[] nodes = new ExprNode[names.length];
          for (int i = 0; i < names.length; i++)
          {
              nodes[i] = new ExprIdentNodeImpl(names[i]);
              validate1StreamMD(nodes[i]);
          }
          return nodes;
      }
  
      public static ExprNode makeIdentNodeBean(String names) throws Exception
      {
          ExprNode node = new ExprIdentNodeImpl(names);
          validate1StreamBean(node);
          return node;
      }
  
      public static ExprNode makeIdentNodeMD(String names) throws Exception
      {
          ExprNode node = new ExprIdentNodeImpl(names);
          validate1StreamMD(node);
          return node;
      }
  
      public static ExprNode makeIdentNodeNoValid(String names) throws Exception
      {
          return new ExprIdentNodeImpl(names);
      }
  
      public static ExprEqualsNode makeEqualsNode() throws Exception
      {
          ExprEqualsNode topNode = new ExprEqualsNodeImpl(false, false);
          ExprIdentNode i1_1 = new ExprIdentNodeImpl("intPrimitive", "s0");
          ExprIdentNode i1_2 = new ExprIdentNodeImpl("intBoxed", "s1");
          topNode.addChildNode(i1_1);
          topNode.addChildNode(i1_2);
  
          validate3Stream(topNode);
  
          return topNode;
      }
  
      public static ExprPreviousNode makePreviousNode() throws Exception
      {
          ExprPreviousNode prevNode = new ExprPreviousNode(ExprPreviousNodePreviousType.PREV);
          ExprNode indexNode = new ExprIdentNodeImpl("intPrimitive", "s1");
          prevNode.addChildNode(indexNode);
          ExprNode propNode = new ExprIdentNodeImpl("doublePrimitive", "s1");
          prevNode.addChildNode(propNode);
  
          validate3Stream(prevNode);
  
          return prevNode;
      }
  
      public static ExprPriorNode makePriorNode() throws Exception
      {
          ExprPriorNode priorNode = new ExprPriorNode();
          ExprNode indexNode = new ExprConstantNodeImpl(1);
          priorNode.addChildNode(indexNode);
          ExprNode propNode = new ExprIdentNodeImpl("doublePrimitive", "s0");
          priorNode.addChildNode(propNode);
  
          validate3Stream(priorNode);
  
          return priorNode;
      }
  
      public static ExprAndNode make2SubNodeAnd() throws Exception
      {
          ExprAndNode topNode = new ExprAndNodeImpl();
  
          ExprEqualsNode e1 = new ExprEqualsNodeImpl(false, false);
          ExprEqualsNode e2 = new ExprEqualsNodeImpl(false, false);
  
          topNode.addChildNode(e1);
          topNode.addChildNode(e2);
  
          ExprIdentNode i1_1 = new ExprIdentNodeImpl("intPrimitive", "s0");
          ExprIdentNode i1_2 = new ExprIdentNodeImpl("intBoxed", "s1");
          e1.addChildNode(i1_1);
          e1.addChildNode(i1_2);
  
          ExprIdentNode i2_1 = new ExprIdentNodeImpl("theString", "s1");
          ExprIdentNode i2_2 = new ExprIdentNodeImpl("theString", "s0");
          e2.addChildNode(i2_1);
          e2.addChildNode(i2_2);
  
          validate3Stream(topNode);
  
          return topNode;
      }
  
      public static ExprNode make3SubNodeAnd() throws Exception
      {
          ExprNode topNode = new ExprAndNodeImpl();
  
          ExprEqualsNode[] equalNodes = new ExprEqualsNode[3];
          for (int i = 0; i < equalNodes.length; i++)
          {
              equalNodes[i] = new ExprEqualsNodeImpl(false, false);
              topNode.addChildNode(equalNodes[i]);
          }
  
          ExprIdentNode i1_1 = new ExprIdentNodeImpl("intPrimitive", "s0");
          ExprIdentNode i1_2 = new ExprIdentNodeImpl("intBoxed", "s1");
          equalNodes[0].addChildNode(i1_1);
          equalNodes[0].addChildNode(i1_2);
  
          ExprIdentNode i2_1 = new ExprIdentNodeImpl("theString", "s1");
          ExprIdentNode i2_2 = new ExprIdentNodeImpl("theString", "s0");
          equalNodes[1].addChildNode(i2_1);
          equalNodes[1].addChildNode(i2_2);
  
          ExprIdentNode i3_1 = new ExprIdentNodeImpl("boolBoxed", "s0");
          ExprIdentNode i3_2 = new ExprIdentNodeImpl("boolPrimitive", "s1");
          equalNodes[2].addChildNode(i3_1);
          equalNodes[2].addChildNode(i3_2);
  
          validate3Stream(topNode);
  
          return topNode;
      }
  
      public static ExprNode makeIdentNode(String fieldName, String streamName) throws Exception
      {
          ExprIdentNode node = new ExprIdentNodeImpl(fieldName, streamName);
          validate3Stream(node);
          return node;
      }
  
      public static ExprNode makeMathNode() throws Exception
      {
          ExprIdentNode node1 = new ExprIdentNodeImpl("intBoxed", "s0");
          ExprIdentNode node2 = new ExprIdentNodeImpl("intPrimitive", "s0");
          ExprMathNode mathNode = new ExprMathNode(MathArithTypeEnum.MULTIPLY, false, false);
          mathNode.addChildNode(node1);
          mathNode.addChildNode(node2);
  
          validate3Stream(mathNode);
  
          return mathNode;
      }
  
      public static ExprNode makeMathNode(MathArithTypeEnum operator_, Object valueLeft_, Object valueRight_) throws Exception
      {
          ExprMathNode mathNode = new ExprMathNode(operator_, false, false);
          mathNode.addChildNode(new SupportExprNode(valueLeft_));
          mathNode.addChildNode(new SupportExprNode(valueRight_));
          validate3Stream(mathNode);
          return mathNode;
      }
  
      public static ExprNode makeSumAndFactorNode() throws Exception
      {
          // sum node
          ExprSumNode sum = new ExprSumNode(false);
          ExprIdentNode ident = new ExprIdentNodeImpl("intPrimitive", "s0");
          sum.addChildNode(ident);
  
          ExprIdentNode node = new ExprIdentNodeImpl("intBoxed", "s0");
          ExprMathNode mathNode = new ExprMathNode(MathArithTypeEnum.MULTIPLY, false, false);
          mathNode.addChildNode(node);
          mathNode.addChildNode(sum);
  
          validate3Stream(mathNode);
  
          return mathNode;
      }
  
      public static ExprAggregateNode makeSumAggregateNode() throws Exception
      {
          ExprSumNode top = new ExprSumNode(false);
          ExprIdentNode ident = new ExprIdentNodeImpl("intPrimitive", "s0");
          top.addChildNode(ident);
  
          validate3Stream(top);
  
          return top;
      }
  
      public static ExprNode makeCountNode(Object value, Class type) throws Exception
      {
          ExprCountNode countNode = new ExprCountNode(false);
  