/** * PUBLIC: * Return the previous object from the collection. * * @return - previous object in stream * @exception - throws exception if read pass first of stream */ public Object previous() throws DatabaseException, QueryException { // CR#4139 loadPrevious(); if (getPreviousObject() == null) { throw QueryException.readBeyondStream(getQuery()); } Object previous = getPreviousObject(); clearNextAndPrevious(); return previous; }
/** * PUBLIC: * This method differs slightly from conventinal read() operation on a Java stream. This * method return the next object in the collection rather than specifying the number of * bytes to be read in. * * Return the next object from the collection, if beyond the read limit read from the cursor * @return - next object in stream * @exception - throws exception if read pass end of stream */ public Object next() throws DatabaseException, QueryException { loadNext(); if (getNextObject() == null) { throw QueryException.readBeyondStream(getQuery()); } Object next = getNextObject(); clearNextAndPrevious(); return next; }
/** * Retrieve next object from the scrollable cursor */ public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectNext = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasNext()) { objectNext = stream.next(); } if (objectNext == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectNext)); } } transporter.setObject(objectNext); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve previous object from the scrollable cursor */ public Transporter scrollableCursorPreviousObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectPrevious = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasPrevious()) { objectPrevious = stream.previous(); } if (objectPrevious == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectPrevious)); } } transporter.setObject(objectPrevious); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve next object from the scrollable cursor */ public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectNext = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasNext()) { objectNext = stream.next(); } if (objectNext == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectNext)); } } transporter.setObject(objectNext); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve previous object from the scrollable cursor */ public Transporter scrollableCursorPreviousObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectPrevious = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasPrevious()) { objectPrevious = stream.previous(); } if (objectPrevious == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectPrevious)); } } transporter.setObject(objectPrevious); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve next object from the scrollable cursor */ public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectNext = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasNext()) { objectNext = stream.next(); } if (objectNext == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectNext)); } } transporter.setObject(objectNext); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }
/** * Retrieve previous object from the scrollable cursor */ public Transporter scrollableCursorPreviousObject(Transporter remoteScrollableCursorOid) { Transporter transporter = new Transporter(); try { ScrollableCursor stream = (ScrollableCursor)getRemoteCursors().get(remoteScrollableCursorOid.getObject()); if (stream != null) { Object objectPrevious = null; // For bug 2797683 read beyond end of stream exception should not be thrown here: called first by RemoteScrollableCursor.hasNext(). if (stream.hasPrevious()) { objectPrevious = stream.previous(); } if (objectPrevious == null) { // 2612538 - the default size of Map (32) is appropriate transporter.setObjectDescriptors(new IdentityHashMap()); } else { if (stream.getQuery().isReadAllQuery() && (!stream.getQuery().isReportQuery())) { transporter.setObjectDescriptors(replaceValueHoldersIn(objectPrevious)); } } transporter.setObject(objectPrevious); } } catch (RuntimeException exception) { transporter.setException(exception); } return transporter; }