/** * @param variable {@inheritDoc}; note that because the unconstrained * {@link Answer} has no columns, there's no valid value for this * @return never * @throws TuplesException always, because there is no valid * <var>variable</var> parameter */ public int getColumnIndex(Variable variable) throws TuplesException { throw new TuplesException("No column " + variable); }
private void notClosed() throws TuplesException { if (transaction == null) { throw new TuplesException("TransactionalAnswer closed"); } else if (answer == null) { throw new TuplesException("TransactionAnswer not closed, but Answer null"); } } }
/** * @param columnName a column name; note that because the unconstrained * {@link Answer} has no columns, there's no valid value for this * @return never * @throws TuplesException always, because there is no valid * <var>column</var> parameter */ public Object getObject(String columnName) throws TuplesException { throw new TuplesException("No column named " + columnName); }
/** * Unconstrained has no columns that can be unbound. * * @throws TuplesException always, because there's no possible valid value * for the <var>column</var> parameter */ public boolean isColumnEverUnbound(int column) throws TuplesException { throw new TuplesException("No such column " + column); }
public boolean isColumnEverUnbound(int column) throws TuplesException { try { return columnEverUnbound[column]; } catch (ArrayIndexOutOfBoundsException e) { throw new TuplesException("No such column " + column, e); } }
public long getColumnValue(int column) throws TuplesException { assert column >= 0; if (tuples == null) { throw new TuplesException("getColumnValue called before beforeFirst()"); } return ((long[]) tuples.get(currentTuple))[column]; }
public boolean next() throws TuplesException { if (iter == null) { throw new TuplesException("next() called before beforeFirst()"); } if (!iter.hasNext()) { currentTriple = null; return false; } else { currentTriple = iter.next(); return true; } }
public int getColumnIndex(Variable variable) throws TuplesException { if (variable == null) throw new IllegalArgumentException("Null \"variable\" parameter"); int index = variableList.indexOf(variable); if (index >= 0) { return index; } else { throw new TuplesException("No such variable " + variable + " in tuples " + variableList + " (" + getClass() + ")"); } }
/** @see org.mulgara.store.tuples.Tuples#getColumnValue(int) */ public long getColumnValue(int column) throws TuplesException { if (column >= nrVars) throw new TuplesException("Invalid column: " + column); return wrapped.getColumnValue(column + offset); }
public static RestrictPredicate getPredicate(ConstraintHaving constraint, ResolverSession session) throws TuplesException { RestrictPredicatePrototype predicate = (RestrictPredicatePrototype)prototypes.get(constraint.getClass()); if (predicate == null) { throw new TuplesException("Unable to obtain predicate matching restrict constraint: " + constraint); } return predicate.duplicate(constraint, session); } }
public void beforeFirst(long[] prefix, int suffixTruncation) throws TuplesException { if (prefix.length > 4) { throw new TuplesException("Prefix too long"); } // Reset skipped. skipped = false; // Move to the tuples.beforeFirst(prefix, suffixTruncation); }
public long getSubject() throws TuplesException { if (currentTriple == null) { throw new TuplesException("getSubject() called before next()"); } return localize(currentTriple.getSubject()); }
public void execute() throws TuplesException { answer.close(); try { transaction.dereference(); } catch (MulgaraTransactionException em) { throw new TuplesException("Error dereferencing transaction", em); } } });
public long getPredicate() throws TuplesException { if (currentTriple == null) { throw new TuplesException("getPredicate() called before next()"); } return localize(currentTriple.getPredicate()); }
public long getObject() throws TuplesException { if (currentTriple == null) { throw new TuplesException("getObject() called before next()"); } return localize(currentTriple.getObject()); }
private void initMaps() throws TuplesException { try { blankNodeIdMap = IntFile.open(TempDir.createTempFile("localIdMap", null), true); blankNodeNameMap = new StringToLongMap(); } catch (IOException ioe) { throw new TuplesException("Unable to localize tuples", ioe); } mapsInitialized = true; }
public int getColumnIndex(Variable column) throws TuplesException { if (column.equals(subject)) { return 0; } else if (column.equals(predicate)) { return 1; } else if (column.equals(object)) { return 2; } else { throw new TuplesException("Variable " + column + " not valid on Statements"); } }
public void close() throws TuplesException { answer.close(); if (mapsInitialized) { blankNodeNameMap.delete(); try { blankNodeIdMap.delete(); } catch (IOException ioe) { throw new TuplesException("Unable to manage temporary files", ioe); } } }
public boolean pass(Tuples tuples) throws TuplesException { try { return session.findStringPoolObject(getLhsValue(tuples)).compareTo( session.findStringPoolObject(getRhsValue(tuples))) < 0; } catch (StringPoolException es) { throw new TuplesException("Failure to extract SPObject from stringpool", es); } } }
private long localize(Value node) throws TuplesException { try { if (!nodeMap.contains(node)) { nodeMap.put(node, persistent ? resolverSession.localizePersistent(node) : resolverSession.localize(node)); } return nodeMap.get(node); } catch (LocalizeException el) { throw new TuplesException("Failed to localize node", el); } }