Package org.eobjects.analyzer.beans.api

Examples of org.eobjects.analyzer.beans.api.OutputColumns


  private Random random = new Random();

  @Override
  public OutputColumns getOutputColumns() {
    String[] columnNames = { nameColumn.getName() + " (greeting)" };
    return new OutputColumns(columnNames);
  }
View Full Code Here


  public OutputColumns getOutputColumns() {
    String[] columns = new String[pattern.matcher("").groupCount()];
    for (int i = 0; i < columns.length; i++) {
      columns[i] = column.getName() + " (group " + (i + 1) + ")";
    }
    return new OutputColumns(column.getName() + " (matched part)", columns);
  }
View Full Code Here

    RegexParserTransformer t = new RegexParserTransformer();
    t.column = col;
    t.pattern = Pattern.compile("(a+)(b+)|(c+)");
   
    OutputColumns outputColumns = t.getOutputColumns();
    assertEquals(4, outputColumns.getColumnCount());
    assertEquals("foobar (matched part)", outputColumns.getColumnName(0));
    assertEquals("foobar (group 1)", outputColumns.getColumnName(1));
    assertEquals("foobar (group 2)", outputColumns.getColumnName(2));
    assertEquals("foobar (group 3)", outputColumns.getColumnName(3));

    assertArrayEquals(new String[] { "aabb", "aa", "bb", null }, t.transform(new MockInputRow().put(col, "aabb")));
    assertArrayEquals(new String[] { "cccc", null, null, "cccc" }, t.transform(new MockInputRow().put(col, "cccc")));
    assertArrayEquals(new String[] { null, null, null, null }, t.transform(new MockInputRow().put(col, "dddd")));
  }
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.beans.api.OutputColumns

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.