com.odi
Class DatabaseSegmentEnumeration

java.lang.Object
  extended bycom.odi.DatabaseSegmentEnumeration
All Implemented Interfaces:
Enumeration

public abstract 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, PSE/PSE Pro 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 PSE/PSE Pro throws SegmentNotFoundException.

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


Method Summary
abstract  boolean hasMoreElements()
          Determines whether or not there are any more segments in the enumeration.
abstract  Object nextElement()
          Obtains the next database segment as an Object.
abstract  Segment nextSegment()
          Obtains the next database segment as a Segment.
 

Method Detail

hasMoreElements

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

Specified by:
hasMoreElements in interface 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.
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.
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.

nextElement

public abstract Object nextElement()
Obtains the next database segment as an Object.

Specified by:
nextElement in interface Enumeration
Returns:
The next segment cast to Object.

Throws:
NoSuchElementException - If there are no more segments.
NoTransactionInProgressException - If a transaction is not in progress.
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.
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.

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.
NoTransactionInProgressException - If a transaction is not in progress.
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.
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 2005 Progress Software Corporation. All rights reserved.