public MutableTupleResult(TupleResult tqr) throws StoreException { this(tqr.getBindingNames(), tqr); }
public BindingSet singleResult() throws StoreException { if (bindingSets.isEmpty()) throw new NoResultException("expected zero, but was:" + bindingSets.size()); if (bindingSets.size() > 1) throw new MultipleResultException("expected zero, but was:" + bindingSets.size()); return this.bindingSets.get(0); }
public MutableTupleResult(Collection<String> bindingNames, Result<? extends BindingSet> bindingSetIter) throws StoreException { this.bindingNames.addAll(bindingNames); bindingSetIter.addTo(this.bindingSets); }
public CharSequence asCharSequence() throws OpenRDFException { Result<CharSequence> result = asResult(CharSequence.class); if (result.hasNext()) return result.singleResult(); return null; }
@Override public boolean hasNext() { try { return graphResult.hasNext(); } catch (StoreException e) { throw new RepositoryException(e); } }
@Override public boolean hasNext() { try { return tupleResult.hasNext(); } catch (StoreException e) { throw new RepositoryException(e); } }
@Override public void close() { try { tupleResult.close(); } catch (StoreException e1) { throw new RepositoryException(e1); } }
@Override public void close() { try { graphResult.close(); } catch (StoreException e1) { throw new RepositoryException(e1); } }
@Override public void close(){ try { statements.close(); } catch (StoreException e1) { throw new RepositoryException(e1); } }
@Override public boolean hasNext() { try { return statements.hasNext(); } catch (StoreException e) { throw new RepositoryException(e); } }
/** * Loads a single Object that is assumed to be of the given concept. */ public <T> T getObject(Class<T> concept, Resource resource) throws RepositoryException, QueryEvaluationException { return getObjects(concept, resource).singleResult(); }
public <T> T as(Class<T> of) throws OpenRDFException { Result<T> result = asResult(of); if (result.hasNext()) return result.singleResult(); return null; }
@Override public boolean hasNext() { try { return graphResult.hasNext(); } catch (StoreException e) { throw new RepositoryException(e); } }
@Override public boolean hasNext() { try { return tupleResult.hasNext(); } catch (StoreException e) { throw new RepositoryException(e); } }
@Override public void close() { try { tupleResult.close(); } catch (StoreException e1) { throw new RepositoryException(e1); } }
@Override public void close(){ try { graphResult.close(); } catch (StoreException e1) { throw new RepositoryException(e1); } }
@Override public void close() { try { statements.close(); } catch (StoreException e1) { throw new RepositoryException(e1); } }
public String asString() throws OpenRDFException { Result<String> result = asResult(String.class); if (result.hasNext()) return result.singleResult(); return null; }
public byte[] asByteArray() throws OpenRDFException { Result<byte[]> result = asResult(byte[].class); if (result.hasNext()) return result.singleResult(); return null; }