Exemplo n.º 1
0
  /**
   * Methods to create a {@link Function} starting from a {@link IsNullExpression}
   *
   * @param pred IsNullExpression
   * @param lookupTable
   * @return a function from the OBDADataFactory
   */
  private Function getFunction(IsNullExpression pred, LookupTable lookupTable) {

    Expression column = pred.getLeftExpression();
    String columnName = column.toString();
    String variableName = lookupTable.lookup(columnName);
    if (variableName == null) {
      throw new RuntimeException("Unable to find column name for variable: " + columnName);
    }
    Term var = dfac.getVariable(variableName);

    if (!pred.isNot()) {
      return dfac.getFunctionIsNull(var);
    } else {
      return dfac.getFunctionIsNotNull(var);
    }
  }
Exemplo n.º 2
0
 public void visit(IsNullExpression isNullExpression) throws Exception {
   isNullExpression.getLeftExpression().accept(this);
 }