Exemplo n.º 1
0
    /** {@inheritDoc} */
    @Override
    public Object getValueAt(int ri, int ci) {
      final BelStatement stmt = statements.get(ri);

      switch (ci) {
        case 0:
          return stmt.getSubjectTerm().getLabel();
        case 1:
          // can return null
          return stmt.getRelationship();
        case 2:
          final BelTerm objTerm = stmt.getObjectTerm();
          final BelStatement objStmt = stmt.getObjectStatement();

          if (objTerm != null) {
            return objTerm.getLabel();
          } else if (objStmt != null) {
            if (objStmt.getSubjectTerm() == null
                || objStmt.getRelationship() == null
                || objStmt.getObjectTerm() == null) {
              return null;
            }

            return objStmt.getSubjectTerm().getLabel()
                + " "
                + objStmt.getRelationship()
                + " "
                + objStmt.getObjectTerm().getLabel();
          }
      }

      return null;
    }
Exemplo n.º 2
0
    /** {@inheritDoc} */
    @Override
    public Object getValueAt(int ri, int ci) {
      final BelTerm term = terms.get(ri);

      switch (ci) {
        case 0:
          return term.getLabel();
      }

      return null;
    }