Class COM.odi.DatabaseSegmentEnumeration

java.lang.Object
   |
   +----COM.odi.DatabaseSegmentEnumeration

public class DatabaseSegmentEnumeration
extends Object
implements Enumeration
The DatabaseSegmentEnumeration class defines the operations for enumerating the segments in a database. A DatabaseSegmentEnumeration object is a list of the segments in a database. An application can create a DatabaseSegmentEnumeration object with a call to Database.getSegments(). The DatabaseSegmentEnumeration object that it creates is valid only until the end of the transaction.

If you create a DatabaseSegmentEnumeration object and then create a new segment, ObjectStore might or might not include the new segment in the enumeration. Consequently, you should create a new enumeration when it matters whether or not the new segment is included in the enumeration.

After an application creates a DatabaseSegmentEnumeration, a segment in the enumeration might get destroyed. In this situation, you might still obtain the destroyed segment, but if you try to do something with it ObjectStore throws SegmentNotFoundException.

When you are using PSE or PSE Pro, a database can have only one segment.


Method Index

 o hasMoreElements()
Determines whether or not there are any more segments in the enumeration.
 o nextElement()
Obtains the next database segment as an Object.

 o nextSegment()
Obtains the next database segment as a Segment.

Methods

 o hasMoreElements
  public abstract boolean hasMoreElements()
Determines whether or not there are any more segments in the enumeration.

Returns:
The true constant if there are more segments to provide. The false constant if all the segments 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: StaleEnumeratorException
If the information for this enumeration has become stale and unusable. This currently occurs at the end of the transaction in which the enumeration was created.
 o nextElement
  public abstract Object nextElement()
Obtains the next database segment as an Object.

Returns:
The next segment cast to Object.

Throws: NoSuchElementException
If there are no more segments.
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: StaleEnumeratorException
If the information for this enumeration has become stale and unusable. This currently occurs at the end of the transaction in which the enumeration was created.
 o nextSegment
  public abstract Segment nextSegment()
Obtains the next database segment as a Segment.

Returns:
The next segment cast to Segment.

Throws: NoSuchElementException
If there are no more segments.
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: StaleEnumeratorException
If the information for this enumeration has become stale and unusable. This currently occurs at the end of the transaction in which the enumeration was created.

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.