All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fitnesse.fixtures.SplitFixture Maven / Gradle / Ivy

There is a newer version: 20181217
Show newest version
package fitnesse.fixtures;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class SplitFixture {
  private String[] lines;

  public SplitFixture(String schema) {
    lines = schema.split(";");
  }

  public List query() {
    List table = new ArrayList<>();
    for (String lineContent : lines) {
      List line = new ArrayList<>();
      String[] words = lineContent.split(",");
      for (int i = 0; i < words.length; i++) {
        String word = words[i];
        line.add(Arrays.asList(Integer.toString(i+1), word));
      }
      table.add(line);
    }
    return table;
  }
}