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

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


        StringBuilder builder = new StringBuilder();
        int numLetters = random.nextInt(100) + 1;
        for (int i = 0; i < numLetters; i++) {
          builder.append('a' + random.nextInt(26));
        }
        return new TextValue(builder.toString());
      case DATETIME:
        return new DateTimeValue(random.nextInt(200) + 1900, random.nextInt(12),
            random.nextInt(28) + 1, random.nextInt(24), random.nextInt(60),
            random.nextInt(60), random.nextInt(999));
      case DATE:
View Full Code Here


    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)));
View Full Code Here

      testData.addRowFromValues("blah", 5, true, c1, c2, c2);
    } 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

    row.addCell(new TableCell(111));
    row.addCell(new TableCell(true));
    rows.add(row);

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

    row = new TableRow();
View Full Code Here

        + "14,2000-02-01 01:10:31.004\nddd,222.0,false,1997-06-05,12:15:15. 14,3100-02-02 15:15:01",
        testData.toString());
  }

  public void testGetCellAndGetValue() {
    assertEquals(new TextValue("ccc"), testData.getValue(1, 0));
    TableCell cell = testData.getCell(1, 0);
    assertEquals("$ccc", cell.getFormattedValue());
  }
View Full Code Here

      if (isReadableLetters(language)) {
        assertTrue(formattedValue.contains("12"));
      }

      // Text
      formattedValue = textFormatter.format(new TextValue("this is a test"));
      assertEquals("this is a test", formattedValue);

      // Date
      formattedValue = dateFormatter.format(new DateValue(1988, 11, 24));
      assertFalse(StringUtils.isEmpty(formattedValue));
View Full Code Here

    // Number
    formattedValue = numberFormatter.format(new NumberValue(-12000.23));
    assertEquals("-12,000.230", formattedValue);

    // Text
    formattedValue = textFormatter.format(new TextValue("this is another test"));
    assertEquals("this is another test", formattedValue);

    // Date
    formattedValue = dateFormatter.format(new DateValue(1988, 11, 24));
    assertEquals("12 | 24 | 88", formattedValue);
View Full Code Here

  public void testParseAll() {
    assertEquals(new NumberValue(22),
        ValueFormatter.createDefault(ValueType.NUMBER, null).parse("22"));

    assertEquals(new TextValue("1a"),
        ValueFormatter.createDefault(ValueType.TEXT, null).parse("1a"));

    assertEquals(BooleanValue.TRUE,
        ValueFormatter.createDefault(ValueType.BOOLEAN, null).parse("true"));
View Full Code Here

    assertEquals(BooleanValue.TRUE, booleanFormatter.parse("1"));
  }

  public void testParseText() {
    ValueFormatter textFormatter = ValueFormatter.createDefault(ValueType.TEXT, null);
    assertEquals(new TextValue("text"), textFormatter.parse("text"));
  }
View Full Code Here

    row.addCell(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

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.