Primavera Integration API 7.0

com.primavera.integration.client.bo
Class BOIterator<T extends BusinessObject>

java.lang.Object
  extended by com.primavera.integration.client.BOIteratorBase
      extended by com.primavera.integration.client.bo.BOIterator<T>
Type Parameters:
T - Any business object type
All Implemented Interfaces:
java.util.Iterator<T>

public class BOIterator<T extends BusinessObject>
extends BOIteratorBase
implements java.util.Iterator<T>

An iterator over a business object collection. Loading multiple business objects always returns a BOIterator.

Not all business objects are necessarily loaded at one time. When many business objects are requested, the results are loaded from the server in subsets. Calling next() will therefore occasionally result in additional calls to the server when larger sets are requested.


Constructor Summary
BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, com.primavera.bo.base.RemoteTXId txId)
          Class constructor used for when an empty BOIterator is needed.
BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, java.lang.String[] aIntgFieldName, ObjectId[] objIds, int iPageSize, com.primavera.bo.common.PRequestOptions opts, com.primavera.bo.base.RemoteTXId txId)
          Class constructor used when loading by ObjectId.
BOIterator(Session session, com.primavera.bo.defs.BusinessObjectDef boDef, com.primavera.infr.db.PrmRowSet rowSet, java.lang.String[] aIntgFieldName, java.lang.String sWhereClause, java.lang.String sOrderBy, com.primavera.bo.common.PRequestOptions opts, com.primavera.bo.base.RemoteTXId txId)
          Class constructor used when loading with where clause and order by clause.
 
Method Summary
 T[] getAll()
          Gets all business objects from loads that are known to have small result sets.
 int getCount()
          Deprecated. As of release 6.0, use hasNext() and next() and iterate over the entire collection to determine the count.
 int getPageSize()
          Returns the page size in use.
 boolean hasNext()
          Indicates if the iterator has more elements.
 T next()
          Gets the next business object in the iteration.
 void remove()
          This method is not supported.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BOIterator

public BOIterator(Session session,
                  com.primavera.bo.defs.BusinessObjectDef boDef,
                  com.primavera.infr.db.PrmRowSet rowSet,
                  com.primavera.bo.base.RemoteTXId txId)
           throws BusinessObjectException
Class constructor used for when an empty BOIterator is needed.

Parameters:
session - session object
boDef - business object definition
rowSet - row set returned from the first load
Throws:
BusinessObjectException
java.lang.IllegalArgumentException - if the input parameter is null or invalid

BOIterator

public BOIterator(Session session,
                  com.primavera.bo.defs.BusinessObjectDef boDef,
                  com.primavera.infr.db.PrmRowSet rowSet,
                  java.lang.String[] aIntgFieldName,
                  java.lang.String sWhereClause,
                  java.lang.String sOrderBy,
                  com.primavera.bo.common.PRequestOptions opts,
                  com.primavera.bo.base.RemoteTXId txId)
           throws BusinessObjectException
Class constructor used when loading with where clause and order by clause.

Parameters:
session - session object
boDef - business object definition
rowSet - row set returned from the first load
aIntgFieldName - array of field names
sWhereClause - where clause
sOrderBy - order by
opts - request options
Throws:
BusinessObjectException
java.lang.IllegalArgumentException - if the input parameter is null or invalid

BOIterator

public BOIterator(Session session,
                  com.primavera.bo.defs.BusinessObjectDef boDef,
                  com.primavera.infr.db.PrmRowSet rowSet,
                  java.lang.String[] aIntgFieldName,
                  ObjectId[] objIds,
                  int iPageSize,
                  com.primavera.bo.common.PRequestOptions opts,
                  com.primavera.bo.base.RemoteTXId txId)
           throws BusinessObjectException
Class constructor used when loading by ObjectId.

Parameters:
session - session object
boDef - business object definition
rowSet - row set returned from the first load
aIntgFieldName - array of field names
objIds - array of ObjectId
iPageSize - page size
opts - request options
Throws:
BusinessObjectException
java.lang.IllegalArgumentException - if the input parameter is null or invalid
Method Detail

getPageSize

public int getPageSize()
Returns the page size in use.

Returns:
page size

hasNext

public boolean hasNext()
Indicates if the iterator has more elements.

Specified by:
hasNext in interface java.util.Iterator<T extends BusinessObject>
Returns:
boolean true if the iterator has more elements.

next

public T next()
Gets the next business object in the iteration.

Specified by:
next in interface java.util.Iterator<T extends BusinessObject>
Returns:
BusinessObject the business object

getAll

public T[] getAll()
                                  throws ServerException,
                                         NetworkException,
                                         BusinessObjectException
Gets all business objects from loads that are known to have small result sets. It is recommended for performance reasons to not use this method but rather to use next() and iterate through all elements

Returns:
BusinessObject[] array of all business objects
Throws:
ServerException - if a problem occurred on the server-side
NetworkException - if a problem occurred in the network layer
BusinessObjectException - if a problem occurred in the client-side business objects

getCount

@Deprecated
public int getCount()
Deprecated. As of release 6.0, use hasNext() and next() and iterate over the entire collection to determine the count.

Gets the total number of business objects from a load. This method may result in an additional call to the server and is generally not recommended for performance reasons.

Returns:
int the total number of business objects

remove

public void remove()
This method is not supported. It will throw UnsupportedOperationException.

Specified by:
remove in interface java.util.Iterator<T extends BusinessObject>

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.