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

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


        row.addCell(new TableCell(NumberValue.getNullValue()));
        row.addCell(new TableCell(true));
        rows.add(row);

        row = new TableRow();
        row.addCell(new TableCell(new TextValue("bbb"), "bb@@b"));
        row.addCell(new TableCell(333));
        row.addCell(new TableCell(true));
        rows.add(row);

        row = new TableRow();
View Full Code Here


                String colValue = rs.getString(column);
                if(colValue == null) {
                    value = TextValue.getNullValue();
                }
                else {
                    value = new TextValue(rs.getString(column));
                }
                break;
        }
        // Handle null values.
        if(rs.wasNull()) {
View Full Code Here

        input.addColumn(new ColumnDescription("isPig", ValueType.BOOLEAN, "label2"));

        TableRow row;

        row = new TableRow();
        row.addCell(new TableCell(new TextValue("aaa")));
        row.addCell(new TableCell(new NumberValue(222)));
        row.addCell(new TableCell(BooleanValue.TRUE, "T"));
        input.addRow(row);

        row = new TableRow();
        row.addCell(new TableCell(new TextValue("ccc")));
        row.addCell(new TableCell(new NumberValue(111)));
        row.addCell(new TableCell(BooleanValue.TRUE, "T"));
        input.addRow(row);

        row = new TableRow();
        row.addCell(new TableCell(new TextValue("bbb")));
        row.addCell(new TableCell(new NumberValue(333)));
        row.addCell(new TableCell(BooleanValue.FALSE, "F"));
        input.addRow(row);
    }
View Full Code Here

                        TimeComponentExtractor.TimeComponent.HOUR)));
        q.setSelection(selection);

        //Add filter.
        QueryFilter filter = new ColumnValueFilter(new SimpleColumn("name"),
                new TextValue("name"), ComparisonFilter.Operator.EQ);
        q.setFilter(filter);

        //Add group.
        QueryGroup group = new QueryGroup();
        group.addColumn(new SimpleColumn("hireDate"));
View Full Code Here

     * Constructs a new TableCell with a text value.
     *
     * @param value The inner text value of this cell.
     */
    public TableCell(String value) {
        this.value = new TextValue(value);
    }
View Full Code Here

        assertEquals("60.0", tableAggregator.getAggregationValue(
                generatePath(new String[]{"1994"}), "Sales",
                AggregationType.SUM).toString());

        Assert.assertEquals(new TextValue("Youthanasia"), tableAggregator.
                getAggregationValue(generatePath(new String[]{}), "Band",
                        AggregationType.MAX));
    }
View Full Code Here

        tree.aggregate(createPath(new String[]{"Bla", "3", "5"}),
                AggregationNodeTest.createValueMap(new String[]{"B", "50"}));
        tree.aggregate(createPath(new String[]{"4"}),
                AggregationNodeTest.createValueMap(new String[]{"C", "10"}));

        Assert.assertEquals(new TextValue("A"),
                tree.getNode(createPath(new String[]{}))
                        .getAggregationValue("Band", AggregationType.MIN));

        assertEquals("75.0", tree.getNode(createPath(
                new String[]{"Bla", "3"})).getAggregationValue(
View Full Code Here

     */
    public void testAggregation() {
        AggregationNode node = newAggregationNode();
        node.aggregate(createValueMap(new String[]{"A", "100"}));
        node.aggregate(createValueMap(new String[]{"B", "50"}));
        assertEquals(new TextValue("B"), node.getAggregationValue(
                "Band", AggregationType.MAX));
        assertEquals("75.0", node.getAggregationValue(
                "Sales", AggregationType.AVG).toString());
    }
View Full Code Here

    /**
     * Test string aggregation.
     */
    public void testStringAggregation() {
        ValueAggregator aggregator = new ValueAggregator(ValueType.TEXT);
        aggregator.aggregate(new TextValue("a"));
        aggregator.aggregate(new TextValue("b"));

        try {
            aggregator.getValue(AggregationType.SUM);
            fail();
        }
        catch(UnsupportedOperationException e) {
            // Expected behavior.
        }
        try {
            aggregator.getValue(AggregationType.AVG);
            fail();
        }
        catch(UnsupportedOperationException e) {
            // Expected behavior.
        }

        assertEquals(new NumberValue(2), aggregator.getValue(AggregationType.COUNT));
        assertEquals(new TextValue("a"), aggregator.getValue(AggregationType.MIN));
        assertEquals(new TextValue("b"), aggregator.getValue(AggregationType.MAX));

    }
View Full Code Here

  boolean bool;
  String dateStr;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case STRING_LITERAL:
      str = stringLiteral();
                             val = new TextValue(str);
      break;
    case INTEGER_LITERAL:
    case DECIMAL_LITERAL:
    case OP_MINUS:
      num = decimalLiteral();
View Full Code Here

TOP

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

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.