Package com.google.visualization.datasource.datatable.value

Examples of com.google.visualization.datasource.datatable.value.NumberValue


    assertTrue(filter instanceof ColumnValueFilter);
    ColumnValueFilter f = (ColumnValueFilter) filter;
    assertEquals("c1", f.getColumn().getId());
    Value val = f.getValue();
    assertTrue(val instanceof NumberValue);
    NumberValue v = (NumberValue) val;
    assertEquals(7.55, v.getValue());
    assertEquals(ComparisonFilter.Operator.LE, f.getOperator());
  }
View Full Code Here


    assertFalse(filter.isMatch(table, row));
  }

  public void testToQueryString() {
    ColumnValueFilter filter1 = new ColumnValueFilter(new SimpleColumn("c2"),
        new NumberValue(100.23), ComparisonFilter.Operator.GE);
    ColumnValueFilter filter2 = new ColumnValueFilter(
        new AggregationColumn(new SimpleColumn("c3"), AggregationType.MAX),
        new DateValue(2007, 2, 3), ComparisonFilter.Operator.LIKE, true);

    assertEquals("`c2` >= 100.23", filter1.toQueryString());
View Full Code Here

    assertTrue(filter instanceof ColumnValueFilter);
    ColumnValueFilter f = (ColumnValueFilter) filter;
    assertEquals("ba ba", f.getColumn().getId());
    Value val = f.getValue();
    assertTrue(val instanceof NumberValue);
    NumberValue v = (NumberValue) val;
    assertEquals(-0.3, v.getValue());
    assertEquals(ComparisonFilter.Operator.LT, f.getOperator());
    assertEquals(true, f.isComparisonOrderReversed());
  }
View Full Code Here

    assertEquals(ComparisonFilter.Operator.NE, filters[2].getOperator());
    assertEquals(ComparisonFilter.Operator.NE, filters[3].getOperator());
    assertEquals(ComparisonFilter.Operator.NE, filters[4].getOperator());

    assertEquals(new TextValue("2008-06-01"), filters[0].getValue());
    assertEquals(new NumberValue(47), filters[1].getValue());
    assertEquals(new NumberValue(6), filters[2].getValue());
    assertEquals(new NumberValue(8), filters[3].getValue());
    assertEquals(new NumberValue(2), filters[4].getValue());

  }
View Full Code Here

    assertTrue(subFilters.get(1) instanceof ColumnColumnFilter);
    assertEquals(new ScalarFunctionColumn(
        Lists.<AbstractColumn>newArrayList(new SimpleColumn("c8"),
            new SimpleColumn("c9")), Sum.getInstance()),
        ((ColumnValueFilter) subFilters.get(0)).getColumn());
    assertEquals(new NumberValue(0),
        ((ColumnValueFilter) subFilters.get(0)).getValue());
    assertEquals(Sets.newHashSet("c10", "c11"),
        subFilters.get(1).getAllColumnIds());
    assertEquals(ComparisonFilter.Operator.EQ,
        ((ComparisonFilter) subFilters.get(0)).getOperator());
View Full Code Here

    ColumnTitle columnTitleMin = new ColumnTitle(Lists.<Value>newArrayList(),
        new AggregationColumn(new SimpleColumn("id"),
            AggregationType.MIN), true);

    ColumnTitle columnTitleCountWithPivot =
        new ColumnTitle(Lists.newArrayList(new NumberValue(3.14),
            BooleanValue.TRUE), new AggregationColumn(new SimpleColumn("id"),
            AggregationType.COUNT), false);

    ColumnTitle columnTitleMinWithPivot =
        new ColumnTitle(Lists.newArrayList(new NumberValue(3.14),
            BooleanValue.TRUE), new AggregationColumn(new SimpleColumn("id"),
            AggregationType.MIN), true);


    ColumnDescription resultColumnDescriptionCount =
View Full Code Here

      return Value.getNullValueFromValueType(type);
    }
    Value value;
    switch (type) {
      case NUMBER:
        return new NumberValue(Double.parseDouble(content));
      case BOOLEAN:
        return BooleanValue.getInstance(Boolean.parseBoolean(content));
      case TEXT:
        return new TextValue(content);
      case DATETIME:
View Full Code Here

    if (random.nextInt(10) == 0) {
      return Value.getNullValueFromValueType(type);
    }
    switch (type) {
      case NUMBER:
        return new NumberValue(random.nextDouble() * 10000 *
            (random.nextInt(2) * 2 - 1));
      case BOOLEAN:
        return BooleanValue.getInstance(random.nextBoolean());
      case TEXT:
        StringBuilder builder = new StringBuilder();
View Full Code Here

    } catch (TypeMismatchException e) {
      fail();
    }
    assertEquals(5, testData.getNumberOfRows());
    assertEquals(testData.getRow(4).getCell(0).getValue().compareTo(new TextValue("blah")), 0);
    assertEquals(testData.getRow(4).getCell(1).getValue().compareTo(new NumberValue(5)), 0);
    assertEquals(testData.getRow(4).getCell(2).getValue().compareTo(BooleanValue.TRUE), 0);
    assertEquals(testData.getRow(4).getCell(3).getValue().compareTo(new DateValue(c1)), 0);
    assertEquals(testData.getRow(4).getCell(4).getValue().compareTo(new TimeOfDayValue(c2)), 0);
    assertEquals(testData.getRow(4).getCell(5).getValue().compareTo(new DateTimeValue(c2)), 0);
  }
View Full Code Here

    rows = Lists.newArrayList();

    TableRow row = new TableRow();
    row.addCell(new TableCell("aaa"));
    row.addCell(new TableCell(new NumberValue(222), "222"));
    row.addCell(new TableCell(false));
    rows.add(row);

    row = new TableRow();
    row.addCell(new TableCell(""));
View Full Code Here

TOP

Related Classes of com.google.visualization.datasource.datatable.value.NumberValue

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.