public void open() throws Exception { for (ResultObjectProvider rop:_rops) rop.open(); _opened = true; }
public void close() throws Exception { _opened = false; for (ResultObjectProvider rop:_rops) rop.close(); }
public void handleCheckedException(Exception e) { if (_rops.length == 0) throw new RuntimeException(e); _rops[0].handleCheckedException(e); }
public LazyForwardResultList(ResultObjectProvider rop) { _rop = rop; try { _rop.open(); } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); } }
private boolean addNext() { try { if (!_rop.next()) { free(); return false; } _list.add(_rop.getResultObject()); return true; } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); return false; } }
public void reset() throws Exception { _rop.reset(); _pos = -1; }
public Object getResultObject() throws Exception { if (_idx < _startIdx || _idx >= _endIdx) throw new NoSuchElementException(String.valueOf(_idx)); return _delegate.getResultObject(); }
public boolean supportsRandomAccess() { return _delegate.supportsRandomAccess(); }
public boolean next() throws Exception { return _delegate.next(); }
public boolean absolute(int pos) throws Exception { _idx = pos + _startIdx; if (_idx >= _endIdx) return false; return _delegate.absolute(_idx); }
public int size() throws Exception { return _delegate.size(); }
public SimpleResultList(ResultObjectProvider rop) { _rop = rop; try { _rop.open(); } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); } }
private boolean addNext() { try { if (!_rop.next()) { free(); return false; } _list.add(_rop.getResultObject()); return true; } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); return false; } }
public void reset() throws Exception { _rop.reset(); _pos = -1; }
public Object getResultObject() throws Exception { if (_idx < _startIdx || _idx >= _endIdx) throw new NoSuchElementException(String.valueOf(_idx)); return _delegate.getResultObject(); }
public boolean supportsRandomAccess() { return _rop.supportsRandomAccess(); }
public boolean next() throws Exception { return _delegate.next(); }
public boolean absolute(int pos) throws Exception { _idx = pos + _startIdx; if (_idx >= _endIdx) return false; return _delegate.absolute(_idx); }
public int size() throws Exception { return _delegate.size(); }
public SimpleResultList(ResultObjectProvider rop) { _rop = rop; try { _rop.open(); } catch (RuntimeException re) { close(); throw re; } catch (Exception e) { close(); _rop.handleCheckedException(e); } }