Package it.cnr.isti.hpc.wikipedia.article

Examples of it.cnr.isti.hpc.wikipedia.article.Table


      if (t.getTitleElement() != null) {
        title = t.getTitleElement().getText();
        if (title == null)
          title = "";
      }
      Table table = new Table(title);
      List<String> currentRow = new ArrayList<String>();
      List<Content> contentList = t.getContentList();
      for (@SuppressWarnings("unused")
      Content c : contentList) {

        int row, col;
        String elem = "";

        try {

          col = t.getTableElement(i).getCol();
          row = t.getTableElement(i).getRow();
          elem = t.getTableElement(i).getText();

        } catch (IndexOutOfBoundsException e) {
          // logger.(
          // "Error creating table {}, Index out of bound - content = {}",
          // table.getName(), c.getText());
          break;

        }
        if (row > 0 && col == 0) {
          if ((currentRow.size() == 1)
              && (currentRow.get(0).equals(table.getName()))) {
            currentRow = new ArrayList<String>();
          } else {
            if (!currentRow.isEmpty())
              table.addRow(currentRow);
            currentRow = new ArrayList<String>();
          }

        }
        currentRow.add(elem);
        i++;
      }
      table.addRow(currentRow);
      tables.add(table);
    }

    article.setTables(tables);
View Full Code Here

TOP

Related Classes of it.cnr.isti.hpc.wikipedia.article.Table

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.