Package prefuse.data.expression

Examples of prefuse.data.expression.NumericLiteral


      }
      e = UnaryExpression();
        if ( t.kind == SUB  && e instanceof NumericLiteral ) {
          Number n = (Number)e.get(null);
          if ( n instanceof Integer ) {
              {if (true) return new NumericLiteral(-1*n.intValue());}
          } if ( n instanceof Double ) {
              {if (true) return new NumericLiteral(-1*n.doubleValue());}
          } if ( n instanceof Long ) {
              {if (true) return new NumericLiteral(-1*n.longValue());}
          } if ( n instanceof Float ) {
              {if (true) return new NumericLiteral(-1*n.floatValue());}
          } else {
              {if (true) return new ArithmeticExpression(ArithmeticExpression.MUL,
                                              new NumericLiteral(-1), e);}
          }
        } else if ( t.kind == SUB ) {
          {if (true) return new ArithmeticExpression(ArithmeticExpression.MUL,
                                          new NumericLiteral(-1), e);}
        } else {
          {if (true) return e;}
        }
      break;
    case NOT:
View Full Code Here


  static final public Expression Literal() throws ParseException {
  Token t;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case INT:
      t = jj_consume_token(INT);
              {if (true) return new NumericLiteral(Integer.parseInt(t.image));}
      break;
    case LONG:
      t = jj_consume_token(LONG);
               {if (true) return new NumericLiteral(Long.parseLong(t.image.substring(0,t.image.length()-1)));}
      break;
    case FLOAT:
      t = jj_consume_token(FLOAT);
                {if (true) return new NumericLiteral(Float.parseFloat(t.image));}
      break;
    case DOUBLE:
      t = jj_consume_token(DOUBLE);
                 {if (true) return new NumericLiteral(Double.parseDouble(t.image));}
      break;
    case STRING:
      t = jj_consume_token(STRING);
                String s = unescape(t.image.substring(1, t.image.length()-1));
                {if (true) return new ObjectLiteral(s);}
View Full Code Here

        t.index(HEADERS[4]);
       
        // where id > 0 && dub > 1 && dub < 20
        ColumnExpression id = new ColumnExpression(HEADERS[0]);
        ColumnExpression dub = new ColumnExpression(HEADERS[4]);
        NumericLiteral x0 = new NumericLiteral(0);
        NumericLiteral xlo = new NumericLiteral(lo);
        NumericLiteral xhi1 = new NumericLiteral(hi-1.0);
        NumericLiteral xhi2 = new NumericLiteral(1.0f);
        Expression xhi = new ArithmeticExpression(
                ArithmeticExpression.ADD, xhi1, xhi2);

        ComparisonPredicate idCmp = new ComparisonPredicate(
                ComparisonPredicate.GTEQ, id, x0);
View Full Code Here

    public void testDerivedColumn() {
        String AVG = "average";
       
        Expression fc = new ColumnExpression(HEADERS[3]);
        Expression dc = new ColumnExpression(HEADERS[4]);
        Expression l2 = new NumericLiteral(2);
       
        Expression add = new ArithmeticExpression(
                ArithmeticExpression.ADD, fc, dc);
        Expression avg = new ArithmeticExpression(
                ArithmeticExpression.DIV, add, l2);
View Full Code Here

TOP

Related Classes of prefuse.data.expression.NumericLiteral

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.