Beispiel #1
0
  private SWCDocument readDocument(CommandLineArguments cmd) throws FileNotFoundException {
    Scanner scanner =
        cmd.getInputFile() != null
            ? new Scanner(new File(cmd.getInputFile()))
            : new Scanner(System.in);
    StringBuilder sb = new StringBuilder();
    while (scanner.hasNextLine()) {
      sb.append(scanner.nextLine() + "\n");
    }
    scanner.close();

    SWCDocument doc = new SWCDocument(sb.toString());
    doc.parse(cmd.getParseOptions());

    return doc;
  }