public abstract class PrintObjectList
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Method and Description |
---|---|
void |
addPrintObjectListListener(PrintObjectListListener listener)
Adds the specified PrintObjectList listener to receive
PrintObjectList events from this print object list.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified PropertyChange listener to receive
PropertyChange events from this print object list.
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the specified VetoableChange listener to receive
VetoableChange events from this print object list.
|
void |
close()
Closes the list so that objects in the list can be garbage collected.
|
PrintObject |
getObject(int index)
Returns one object from the list.
|
java.util.Enumeration |
getObjects()
Returns an enumeration of the PrintObjects in the list.
|
AS400 |
getSystem()
Returns the system name.
|
boolean |
isCompleted()
Checks if a list that was opened asynchronously has completed.
|
void |
openAsynchronously()
Builds the list asynchronously.
|
void |
openSynchronously()
Builds the list synchronously.
|
void |
removePrintObjectListListener(PrintObjectListListener listener)
Removes the specified PrintObjectList listener
so that it no longer receives PrintObjectList events
from this print object list.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified PropertyChange listener
so that it no longer receives PropertyChange events
from this print object list.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the specified VetoableChange listener
so that it no longer receives VetoableChange events
from this print object list.
|
void |
resetAttributesToRetrieve()
Resets the list of object attributes to retrieve.
|
void |
resetFilter()
Resets the list filter back to default values.
|
void |
setAttributesToRetrieve(int[] attributes)
Sets the attributes of the object that should be returned in the list.
|
void |
setCache(boolean setting)
Sets whether or not to internally maintain a cache of objects returned by this list.
|
void |
setSystem(AS400 system)
Sets the system name.
|
int |
size()
Returns the current size of the list.
|
void |
waitForItem(int itemNumber)
Blocks until the number of requested items are done being built.
|
void |
waitForListToComplete()
Blocks until the list is done being built.
|
public void setCache(boolean setting)
However, if code wishes to open the list asynchronously and use a PrintObjectListListener to receive listObjectAdded() events, the objects in the list are returned on those events. So, in some cases, there is no need for this PrintObjectList to maintain a reference to all of the objects returned, since they can be processed individually by the listener. Calling this method with a value of true will save memory in these cases, but the getObjectList() method will return an empty Enumeration, so this method only becomes useful if code has registered a PrintObjectListListener with this PrintObjectList.
setting
- true to enable caching; false to disable cachingaddPrintObjectListListener(com.ibm.as400.access.PrintObjectListListener)
,
getObjects()
,
PrintObjectListEvent.getObject()
,
PrintObjectListListener.listObjectAdded(com.ibm.as400.access.PrintObjectListEvent)
public void addPrintObjectListListener(PrintObjectListListener listener)
listener
- The PrintObjectList listener.removePrintObjectListListener(com.ibm.as400.access.PrintObjectListListener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChange listener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChange listener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public void close()
public PrintObject getObject(int index)
index
- The index of the desired object.java.lang.ArrayIndexOutOfBoundsException
- If an invalid index is given.public java.util.Enumeration getObjects()
public final AS400 getSystem()
public boolean isCompleted() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, RequestNotSupportedException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.RequestNotSupportedException
- If the requested function is not supported because
the system operating system is not at the correct level.public void openAsynchronously()
public void openSynchronously() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, RequestNotSupportedException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.RequestNotSupportedException
- If the requested function is not supported because the
system operating system is not at the correct level.public void removePrintObjectListListener(PrintObjectListListener listener)
listener
- The PrintObjectList listener.addPrintObjectListListener(com.ibm.as400.access.PrintObjectListListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChange listener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChange listener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public void resetAttributesToRetrieve()
public void resetFilter()
public void setAttributesToRetrieve(int[] attributes)
attributes
- An array of attribute IDs that define which
object attributes will be retrieved for each item in the list
when the list is opened.PrintObject
public final void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The system name.java.beans.PropertyVetoException
- If the change is vetoed.public int size()
public void waitForItem(int itemNumber) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, RequestNotSupportedException
itemNumber
- The number of items to wait for before returning.
Must be greater than 0;AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.RequestNotSupportedException
- If the requested funtion is not supported because the
system operating system is not at the correct level.public void waitForListToComplete() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, RequestNotSupportedException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.RequestNotSupportedException
- If the requested function is not supported because the
system operating system is not at the correct level.