Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.model
Interface ResultSetEnumeration

All Superinterfaces:
java.util.Enumeration, ManagedContext

public interface ResultSetEnumeration
extends java.util.Enumeration, ManagedContext

This is a "cursor" based Enumeration.


Method Summary
 ModelObject absolute(int element)
          Moves the cursor to the given element number in the result set.
 void close()
          Releases this ResultSetEnumeration object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.
 ModelObject first()
          Returns the first object
 boolean hasNextElement()
          Tests if this enumeration contains next element.
 boolean hasPreviousElement()
          Tests if this enumeration contains previous element.
 boolean isClosed()
          Tests to see if this ResultSetEnumeration is closed.
 boolean isFirst()
          Indicates whether the cursor is on the first row of the result set.
 boolean isLast()
          Indicates whether the cursor is on the last row of the result set.
 ModelObject last()
          Returns the last object
 ModelObject next()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 ModelObject[] next(int n)
          Returns the next n elements of this enumeration if this enumeration object has at least one more element to provide.
 ModelObject previous()
          Returns the previous element of this enumeration if this enumeration object has at least one more element to provide.
 ModelObject[] previous(int n)
          Returns the previous n elements of this enumeration if this enumeration object has at least one more element to provide.
 ModelObject relative(int elements)
          Moves the cursor a relative number of elements, either positive or negative.

 

Methods inherited from interface java.util.Enumeration
hasMoreElements, nextElement

 

Methods inherited from interface oracle.panama.rt.ManagedContext
invalidate

 

Method Detail

absolute

public ModelObject absolute(int element)
                     throws java.util.NoSuchElementException
Moves the cursor to the given element number in the result set. If the element number is positive, the cursor moves to the given element number with respect to the beginning of the result set. If the given element number is negative, the cursor moves to an absolute element position with respect to the end of the result set. An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before/after the first/last row, respectively. Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().
Parameters:
element - the requested element number
Returns:
the relative element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.

relative

public ModelObject relative(int elements)
                     throws java.util.NoSuchElementException
Moves the cursor a relative number of elements, either positive or negative. Attempting to move beyond the first/last element in the result set positions the cursor before/after the first/last row. Calling relative(0) is valid, but does not change the cursor position. Note: Calling relative(1) is different from calling next() because is makes sense to call next() when there is no current row, for example, when the cursor is positioned before the first row or after the last row of the result set.
Parameters:
elements - the requested elements
Returns:
the relative element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.

hasNextElement

public boolean hasNextElement()
Tests if this enumeration contains next element.
Returns:
true if and only if this enumeration object contains at least one more next element to provide; false otherwise.

next

public ModelObject next()
                 throws java.util.NoSuchElementException
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
Returns:
the next element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.

next

public ModelObject[] next(int n)
                   throws java.util.NoSuchElementException
Returns the next n elements of this enumeration if this enumeration object has at least one more element to provide.
Parameters:
n - is the number of the requested next elements of this enumeration.
Returns:
the array with the next element of this enumeration. The length of the array indicates the actual number of elements
Throws:
java.util.NoSuchElementException - if no more elements exist.

hasPreviousElement

public boolean hasPreviousElement()
Tests if this enumeration contains previous element.
Returns:
true if and only if this enumeration object contains at least one more previous element to provide; false otherwise.

previous

public ModelObject previous()
                     throws java.util.NoSuchElementException
Returns the previous element of this enumeration if this enumeration object has at least one more element to provide.
Returns:
the previous element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.

previous

public ModelObject[] previous(int n)
                       throws java.util.NoSuchElementException
Returns the previous n elements of this enumeration if this enumeration object has at least one more element to provide.
Parameters:
n - is the number of the requested next elements of this enumeration.
Returns:
the array with the previous element of this enumeration. The length of the array indicates the actual number of elements
Throws:
java.util.NoSuchElementException - if no more elements exist.

first

public ModelObject first()
                  throws java.util.NoSuchElementException
Returns the first object
Returns:
ModelObject the first object
Throws:
java.util.NoSuchElementException - if no more elements exist.

isFirst

public boolean isFirst()
Indicates whether the cursor is on the first row of the result set.
Returns:
true if the cursor is on the first row, false otherwise.

last

public ModelObject last()
                 throws java.util.NoSuchElementException
Returns the last object
Returns:
ModelObject the last object
Throws:
java.util.NoSuchElementException - if no more elements exist.

isLast

public boolean isLast()
Indicates whether the cursor is on the last row of the result set.
Returns:
true if the cursor is on the last row, false otherwise.

close

public void close()
Releases this ResultSetEnumeration object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

isClosed

public boolean isClosed()
Tests to see if this ResultSetEnumeration is closed.
Returns:
true if the it is closed; false if it's still open

Oracle Application Server Wireless Java API Reference
B10400-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.