Examples of TextValue


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

    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

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

    selection.addColumn(new AggregationColumn(new SimpleColumn("B"), AggregationType.MAX));
    q.setSelection(selection);
    QuerySort sort = new QuerySort();
    sort.addSort(new ColumnSort(new SimpleColumn("A"), SortOrder.DESCENDING));
    q.setSort(sort);
    QueryFilter filter = new ColumnValueFilter(new SimpleColumn("A"), new TextValue("foo"),
                                               ComparisonFilter.Operator.GT);
    q.setFilter(filter);
    q.setRowLimit(7);
    q.setRowOffset(17);
    QueryLabels labels = new QueryLabels();
View Full Code Here

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

  public void testEvaluate() {
    Upper upper = Upper.getInstance();

    // Test empty string.
    TextValue textValue = (TextValue) upper.evaluate(
        Lists.<Value>newArrayList(new TextValue("")));
    assertEquals(textValue.getValue(), "");

    // Basic test.
    textValue = (TextValue) upper.evaluate(
        Lists.<Value>newArrayList(new TextValue("aBc")));
    assertEquals(textValue.getValue(), "ABC");
  }
View Full Code Here

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

  public void testEvaluate() {
    Lower lower = Lower.getInstance();

    // Test empty string.
    TextValue textValue = (TextValue) lower.evaluate(
        Lists.<Value>newArrayList(new TextValue("")));
    assertEquals(textValue.getValue(), "");

    // Basic test.
    textValue = (TextValue) lower.evaluate(
        Lists.<Value>newArrayList(new TextValue("AbC")));
    assertEquals(textValue.getValue(), "abc");
  }
View Full Code Here

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

    ConcreteComparisonFilter greaterOrEqualsFilter =
        new ConcreteComparisonFilter(ComparisonFilter.Operator.GE);

    assertTrue(equalsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(123)));
    assertTrue(equalsFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abc")));
    assertTrue(equalsFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.TRUE));
    assertFalse(equalsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(345)));
    assertFalse(equalsFilter.isOperatorMatch(new TextValue("ab"),
        new TextValue("abc")));

    assertTrue(lessThanFilter.isOperatorMatch(new NumberValue(123.123),
        new NumberValue(123.124)));
    assertTrue(lessThanFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abd")));
    assertTrue(lessThanFilter.isOperatorMatch(BooleanValue.FALSE,
        BooleanValue.TRUE));
    assertFalse(lessThanFilter.isOperatorMatch(new NumberValue(7),
        new NumberValue(-14)));
    assertFalse(lessThanFilter.isOperatorMatch(new TextValue("bbb"),
        new TextValue("aaa")));
    assertFalse(lessThanFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.FALSE));

    assertTrue(lessOrEqualsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(123)));
    assertTrue(lessOrEqualsFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abc")));
    assertTrue(lessOrEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.TRUE));
    assertTrue(lessOrEqualsFilter.isOperatorMatch(new NumberValue(123.123),
        new NumberValue(123.124)));
    assertTrue(lessOrEqualsFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abd")));
    assertTrue(lessOrEqualsFilter.isOperatorMatch(BooleanValue.FALSE,
        BooleanValue.TRUE));
    assertFalse(lessOrEqualsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(122.2)));
    assertFalse(lessOrEqualsFilter.isOperatorMatch(new TextValue("ab"),
        new TextValue("aa")));
    assertFalse(lessOrEqualsFilter.isOperatorMatch(new NumberValue(7),
        new NumberValue(-14)));
    assertFalse(lessOrEqualsFilter.isOperatorMatch(new TextValue("bbb"),
        new TextValue("aaa")));
    assertFalse(lessOrEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.FALSE));

    assertFalse(notEqualsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(123)));
    assertFalse(notEqualsFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abc")));
    assertFalse(notEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.TRUE));
    assertTrue(notEqualsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(345)));
    assertTrue(notEqualsFilter.isOperatorMatch(new TextValue("ab"),
        new TextValue("abc")));

    assertFalse(greaterOrEqualsFilter.isOperatorMatch(new NumberValue(123.123),
        new NumberValue(123.124)));
    assertFalse(greaterOrEqualsFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abd")));
    assertFalse(greaterOrEqualsFilter.isOperatorMatch(BooleanValue.FALSE,
        BooleanValue.TRUE));
    assertTrue(greaterOrEqualsFilter.isOperatorMatch(new NumberValue(7),
        new NumberValue(-14)));
    assertTrue(greaterOrEqualsFilter.isOperatorMatch(new TextValue("bbb"),
        new TextValue("aaa")));
    assertTrue(greaterOrEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.FALSE));

    assertFalse(greaterThanFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(123)));
    assertFalse(greaterThanFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abc")));
    assertFalse(greaterThanFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.TRUE));
    assertFalse(greaterThanFilter.isOperatorMatch(new NumberValue(123.123),
        new NumberValue(123.124)));
    assertFalse(greaterThanFilter.isOperatorMatch(new TextValue("abc"),
        new TextValue("abd")));
    assertFalse(greaterThanFilter.isOperatorMatch(BooleanValue.FALSE,
        BooleanValue.TRUE));
    assertTrue(greaterThanFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(122.2)));
    assertTrue(greaterThanFilter.isOperatorMatch(new TextValue("ab"),
        new TextValue("aa")));
    assertTrue(greaterThanFilter.isOperatorMatch(new NumberValue(7),
        new NumberValue(-14)));
    assertTrue(greaterThanFilter.isOperatorMatch(new TextValue("bbb"),
        new TextValue("aaa")));
    assertTrue(greaterThanFilter.isOperatorMatch(BooleanValue.TRUE,
        BooleanValue.FALSE));

    // Test type mismatch:
    assertFalse(greaterThanFilter.isOperatorMatch(new TextValue("blah"),
        new NumberValue(123)));
    assertFalse(equalsFilter.isOperatorMatch(new DateValue(2000, 3, 3),
        BooleanValue.TRUE));
  }
View Full Code Here

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

    ConcreteComparisonFilter matchesFilter = new ConcreteComparisonFilter(
        ComparisonFilter.Operator.MATCHES);
    ConcreteComparisonFilter likeFilter = new ConcreteComparisonFilter(
        ComparisonFilter.Operator.LIKE);

    assertTrue(containsFilter.isOperatorMatch(new TextValue("blah blah"),
        new TextValue("ah bl")));
    assertTrue(containsFilter.isOperatorMatch(new TextValue("foo bar"),
        new TextValue("foo ")));
    assertTrue(containsFilter.isOperatorMatch(new TextValue("foo bar"),
        new TextValue(" bar")));
    assertFalse(containsFilter.isOperatorMatch(new TextValue("abc123"),
        new TextValue("bd")));

    assertTrue(startsWithFilter.isOperatorMatch(new TextValue("this is a " +
        "text value"), new TextValue("this is")));
    assertFalse(startsWithFilter.isOperatorMatch(new TextValue("foo bar"),
        new TextValue("oo bar")));

    assertTrue(endsWithFilter.isOperatorMatch(new TextValue("this is a " +
        "text value"), new TextValue("text value")));
    assertFalse(endsWithFilter.isOperatorMatch(new TextValue("foo bar"),
        new TextValue("foo ba")));

    assertTrue(matchesFilter.isOperatorMatch(new TextValue("aaaaaa123"),
        new TextValue("a*123")));
    assertTrue(matchesFilter.isOperatorMatch(new TextValue("abcdefghijk"),
        new TextValue("[a-k]+")));
    assertFalse(matchesFilter.isOperatorMatch(new TextValue("abc1234"),
        new TextValue("a*123")));
    assertFalse(matchesFilter.isOperatorMatch(new TextValue("blah blah"),
        new TextValue("%^@%!%$#^*&*$!@#$((((")));
    // Test partial
    assertFalse(matchesFilter.isOperatorMatch(new TextValue("aaaaaaa123"),
        new TextValue("a*")));

    assertTrue(likeFilter.isOperatorMatch(new TextValue("aaaabbbccc"),
        new TextValue("a%b_b%c")));
    assertFalse(likeFilter.isOperatorMatch(new TextValue("aaaabbbccc"),
        new TextValue("aaqqb_c%c")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("aaaabbbccc"),
        new TextValue("a%%b_b%c")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("aaaabbbccc"),
        new TextValue("%")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("foo bar"),
        new TextValue("foo_bar")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("foo%bar"),
        new TextValue("foo_bar")));
    assertFalse(likeFilter.isOperatorMatch(new TextValue("blah blah"),
        new TextValue("bla%b%aa")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("foobar"),
        new TextValue("foo__r")));
    assertFalse(likeFilter.isOperatorMatch(new TextValue("foobr"),
        new TextValue("foo__r")));
    assertFalse(likeFilter.isOperatorMatch(new TextValue("foobaar"),
        new TextValue("foo__r")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("foobaar"),
        new TextValue("foo__%_r")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("foobaaar"),
        new TextValue("foo__%_r")));
    assertTrue(likeFilter.isOperatorMatch(new TextValue("foobaaaar"),
        new TextValue("foo__%_r")));
    assertFalse(likeFilter.isOperatorMatch(new TextValue("foobar"),
        new TextValue("foo__%_r")));
    assertFalse(likeFilter.isOperatorMatch(new TextValue("foobr"),
        new TextValue("foo__%_r")));

    // Partial match:
    assertFalse(likeFilter.isOperatorMatch(new TextValue("blah blah"),
        new TextValue("bla%b%a")));

    // Test non-strings:
    assertTrue(containsFilter.isOperatorMatch(new NumberValue(123),
        new NumberValue(3)));
    assertTrue(containsFilter.isOperatorMatch(new NumberValue(123.45),
        new TextValue("23.4")));
    assertFalse(containsFilter.isOperatorMatch(new NumberValue(23423),
        BooleanValue.TRUE));

    assertTrue(startsWithFilter.isOperatorMatch(BooleanValue.FALSE,
        new TextValue("fa")));

    assertTrue(endsWithFilter.isOperatorMatch(new NumberValue(123.456),
        new TextValue("456")));

    assertTrue(matchesFilter.isOperatorMatch(new NumberValue(123),
        new TextValue(".*")));

    assertTrue(likeFilter.isOperatorMatch(new NumberValue(123),
        new TextValue("_2%")));
  }
View Full Code Here

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

    selection.addColumn(new AggregationColumn(new SimpleColumn("B"), AggregationType.MAX));
    q.setSelection(selection);
    QuerySort sort = new QuerySort();
    sort.addSort(new ColumnSort(new SimpleColumn("A"), SortOrder.DESCENDING));
    q.setSort(sort);
    QueryFilter filter = new ColumnValueFilter(new SimpleColumn("A"), new TextValue("foo"),
                                               ComparisonFilter.Operator.GT);
    q.setFilter(filter);
    q.setRowLimit(7);
    q.setRowOffset(17);
    QueryLabels labels = new QueryLabels();
View Full Code Here

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

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

    testData.addColumn(c5);

    rows = Lists.newArrayList();

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

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

  }

  public void testConstructorString() {
    TableCell cell = new TableCell("string");
    assertNotNull(cell);
    assertEquals(new TextValue("string"), cell.getValue());
  }
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.