Examples of TextValue


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

      case NUMBER:
        return new NumberValue(Double.parseDouble(content));
      case BOOLEAN:
        return BooleanValue.getInstance(Boolean.parseBoolean(content));
      case TEXT:
        return new TextValue(content);
      case DATETIME:
        String[] mainSplit = content.split(" ");
        String[] dateSplit = mainSplit[0].split("-");
        String[] timeSplit = mainSplit[1].split(":");
        int year = Integer.parseInt(dateSplit[0]);
View Full Code Here

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

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

    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

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

      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

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

    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

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

        + "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

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

      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

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

    // 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

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

  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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.