Class COM.odi.SegmentObjectEnumeration
java.lang.Object
|
+----COM.odi.SegmentObjectEnumeration
- public class SegmentObjectEnumeration
- extends Object
- implements Enumeration, Iterator
The SegmentObjectEnumeration class defines the operations for
enumerating the objects in a segment. A SegmentObjectEnumeration
object is a list of the objects in a segment. An application can
create a SegmentObjectEnumeration object with a call to
Segment.getObjects(). The
SegmentObjectEnumeration object that it creates is valid
across transactions. If a transaction in which you are using a
SegmentObjectEnumeration aborts, the SegmentObjectEnumeration
becomes stale.
If you create a SegmentObjectEnumeration object and then create a new
object in the segment, ObjectStore might or might not include the new
object in the enumeration. Consequently, you should create a new
enumeration object when it is important whether or not the new
object is included in the enumeration.
If you create an enumeration and then destroy an object,
ObjectStore skips it when you are iterating through the
enumeration.
-
hasMoreElements()
- Determines whether or not there are any more objects in the enumeration.
-
hasNext()
- Determines whether or not there are any more objects in the enumeration.
-
next()
- Obtains the next object in the segment.
-
nextElement()
- Obtains the next object in the segment.
-
remove()
- This method is not implemented for this class.
hasMoreElements
public abstract boolean hasMoreElements()
- Determines whether or not there are any more objects in the enumeration.
- Returns:
- The true constant if there are more objects to
provide. The false constant if all the objects have been
provided.
- Throws: NoTransactionInProgressException
- If a transaction is not in
progress.
- Throws: ObjectStoreException
- If the session implied by the enumeration
has been terminated or if the current thread is associated with a session
other than the session implied by the enumeration.
- Throws: SegmentNotFoundException
- If the segment is not found.
- Throws: DatabaseNotOpenException
- If the database containing the
segment is not open.
- Throws: StaleEnumeratorException
- If the information for this
enumeration has become stale and unusable. This currently occurs at the
end of an aborted transaction in which the enumerator was last used.
nextElement
public abstract Object nextElement()
- Obtains the next object in the segment.
- Returns:
- The next object.
- Throws: NoSuchElementException
- If there are no more objects.
- Throws: NoTransactionInProgressException
- If a transaction is not in
progress.
- Throws: ObjectStoreException
- If the session implied by the enumeration
has been terminated or if the current thread is associated with a session
other than the session implied by the enumeration.
- Throws: SegmentNotFoundException
- If the segment is not found.
- Throws: DatabaseNotOpenException
- If the database containing the
segment is not open.
- Throws: StaleEnumeratorException
- If the information for this
enumeration has become stale and unusable. This currently occurs at the
end of an aborted transaction in which the enumerator was last used.
hasNext
public abstract boolean hasNext()
- Determines whether or not there are any more objects in the enumeration.
- Returns:
- The true constant if there are more objects to
provide. The false constant if all the objects have been
provided.
- Throws: NoTransactionInProgressException
- If a transaction is not in
progress.
- Throws: ObjectStoreException
- If the session implied by the enumeration
has been terminated or if the current thread is associated with a session
other than the session implied by the enumeration.
- Throws: SegmentNotFoundException
- If the segment is not found.
- Throws: DatabaseNotOpenException
- If the database containing the
segment is not open.
- Throws: StaleEnumeratorException
- If the information for this
enumeration has become stale and unusable. This currently occurs at the
end of an aborted transaction in which the enumerator was last used.
next
public abstract Object next()
- Obtains the next object in the segment.
- Returns:
- The next object.
- Throws: NoSuchElementException
- If there are no more objects.
- Throws: NoTransactionInProgressException
- If a transaction is not in
progress.
- Throws: ObjectStoreException
- If the session implied by the enumeration
has been terminated or if the current thread is associated with a session
other than the session implied by the enumeration.
- Throws: SegmentNotFoundException
- If the segment is not found.
- Throws: DatabaseNotOpenException
- If the database containing the
segment is not open.
- Throws: StaleEnumeratorException
- If the information for this
enumeration has become stale and unusable. This currently occurs at the
end of an aborted transaction in which the enumerator was last used.
remove
public void remove()
- This method is not implemented for this class.
A call to this method results in an exception being thrown.
- Throws: UnsupportedOperationException
- Thrown whenever this method is
called.
Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.