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

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


  @Override
  public void setUp() throws Exception {
    super.setUp();
    storedFormattedValue = "21-Feb-2007";
    dateValue = new DateValue(2007, 1, 21);
  }
View Full Code Here


    @Override
    public void setUp() throws Exception {
        super.setUp();
        storedFormattedValue = "21-Feb-2007";
        dateValue = new DateValue(2007, 1, 21);
    }
View Full Code Here

        TableRow row = new TableRow();
        row.addCell(new TableCell(new TextValue("aaa"), "aaa"));
        row.addCell(new TableCell(new NumberValue(222), "222"));
        row.addCell(new TableCell(BooleanValue.TRUE, "true"));
        row.addCell(new TableCell(new DateValue(2009, 1, 1), "2009-02-01"));
        row.addCell(new TableCell(new DateTimeValue(2009, 1, 1, 12, 14, 1, 0), "2009-02-01 12:14:01"));
        row.addCell(new TableCell(new TimeOfDayValue(12, 14, 1), "12:14:01"));
        rows.add(row);

        row = new TableRow();
        row.addCell(new TableCell(new TextValue("aaa"), "a,aa"));
        row.addCell(new TableCell(new NumberValue(222), "2,22"));
        row.addCell(new TableCell(BooleanValue.TRUE, "true,"));
        row.addCell(new TableCell(new DateValue(2009, 1, 1), "2009-02-01"));
        row.addCell(new TableCell(new DateTimeValue(2009, 1, 1, 12, 14, 1, 0), "2009-02-01 12,14,01"));
        row.addCell(new TableCell(new TimeOfDayValue(12, 14, 1), "12:14:01"));
        rows.add(row);

        testData.addRows(rows);
View Full Code Here

        TableRow row = new TableRow();
        row.addCell(new TableCell("aaa"));
        row.addCell(new TableCell(222));
        row.addCell(new TableCell(false));
        row.addCell(new TableCell(new DateValue(2001, 10, 14)));
        row.addCell(new TableCell(new TimeOfDayValue(12, 11, 13, 14)));
        row.addCell(new TableCell(new DateTimeValue(2000, 10, 1, 1, 10, 23, 432)));
        rows.add(row);

        row = new TableRow();
        row.addCell(new TableCell(new TextValue("ccc"), "$ccc"));
        row.addCell(new TableCell(111));
        row.addCell(new TableCell(true));
        row.addCell(new TableCell(new DateValue(2001, 1, 14)));
        row.addCell(new TableCell(new TimeOfDayValue(12, 30, 13, 14)));
        row.addCell(new TableCell(new DateTimeValue(1000, 11, 1, 1, 10, 23, 432)));
        rows.add(row);

        row = new TableRow();
        row.addCell(new TableCell("bbb"));
        row.addCell(new TableCell(3));
        row.addCell(new TableCell(true));
        row.addCell(new TableCell(new DateValue(2012, 2, 14)));
        row.addCell(new TableCell(new TimeOfDayValue(12, 11, 3, 14)));
        row.addCell(new TableCell(new DateTimeValue(2000, 1, 1, 1, 10, 31, 4)));
        rows.add(row);

        row = new TableRow();
        row.addCell("ddd");
        row.addCell(222);
        row.addCell(false);
        row.addCell(new DateValue(1997, 5, 5));
        row.addCell(new TimeOfDayValue(12, 15, 15, 14));
        row.addCell(new DateTimeValue(3100, 1, 2, 15, 15, 1, 0));
        rows.add(row);

        testData.addRows(rows);
View Full Code Here

        }
        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

        DataTable dataTable = testData.clone();

        TableCell newNumberValueCell = new TableCell(new NumberValue(5699), "5699$");
        newNumberValueCell.setCustomProperty("testProperty", "A test property");
        TableCell newBooleanValueCell = new TableCell(false);
        TableCell newDateValueCell = new TableCell(new DateValue(2011, 3, 6), "03/06/2011");

        dataTable.setCell(1, 1, newNumberValueCell);
        dataTable.setCell(2, 2, newBooleanValueCell);
        dataTable.setCell(2, 3, newDateValueCell);
View Full Code Here

        TableRow row = new TableRow();
        row.addCell(true);
        row.addCell(BooleanValue.getNullValue());
        row.addCell(-2.3);
        row.addCell("foo");
        row.addCell(new DateValue(2008, 2, 3));
        row.getCell(2).setFormattedValue("bar-2.3");
        row.getCell(4).setCustomProperty("foo", "bar");

        TableRow clonedRow = row.clone();
View Full Code Here

          // Set the year, month and date in the gregorian calendar.
          // Use the 'set' method with those parameters, and not the 'setTime'
          // method with the date parameter, since the Date object contains the
          // current time zone and it's impossible to change it to 'GMT'.
          gc.setTime(date);
          value = new DateValue(gc);
        }
        break;
      case DATETIME:
        Timestamp timestamp = rs.getTimestamp(column);
        // If timestamp is null it is handled later.
View Full Code Here

        try {
            int year = Integer.parseInt(split[0]);
            int month = Integer.parseInt(split[1]);
            month--; // normalize 1-12 to 0-11.
            int day = Integer.parseInt(split[2]);
            return new DateValue(year, month, day);
        }
        catch(NumberFormatException e) {
            log.error(String.format(dateMessage, s));
            throw new InvalidQueryException(String.format(dateMessage, s));
        }
View Full Code Here

                query.getPivot().getColumnIds());
    }

    public void testDateLiterals() throws Exception {
        Query query = QueryBuilder.getInstance().parseQuery("WHERE c1 > DATE '2006-08-23'");
        assertEquals(new DateValue(2006, 7, 23),
                ((ColumnValueFilter) query.getFilter()).getValue());
        query = QueryBuilder.getInstance().parseQuery(
                "WHERE c1 = DaTeTiMe '2007-01-30 15:33:22.432'");
        assertEquals(new DateTimeValue(2007, 0, 30, 15, 33, 22, 432),
                ((ColumnValueFilter) query.getFilter()).getValue());
View Full Code Here

TOP

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

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.