com.ibm.as400.resource

Class BufferedResourceList

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    SystemResourceList

    Deprecated. 
    Use packages com.ibm.as400.access and com.ibm.as400.access.list instead.

    public class BufferedResourceList
    extends ResourceList
    The BufferedResourceList class represents a subclass of the ResourceList class which manages a list of resources and buffers them efficiently. This class is intended to be extended and customized by subclasses.

    The list is retrieved in pages, and each page contains multiple resources (those which make up the list). The higher that page size, the more resources are retrieved at once. While the page size does not affect functionality of the list, it may influence performance. For instance, setting the page size to match the number of rows presented in a GUI or servlet may improve overall response time. Call the setPageSize() method to set a specific page size.

    See Also:
    Serialized Form
    • Constructor Detail

      • BufferedResourceList

        public BufferedResourceList()
        Deprecated. 
        Constructs a BufferedResourceList object.
      • BufferedResourceList

        public BufferedResourceList(Presentation presentation,
                            ResourceMetaData[] attributeMetaData,
                            ResourceMetaData[] selectionMetaData,
                            ResourceMetaData[] sortMetaData)
        Deprecated. 
        Constructs a BufferedResourceList object.
        Parameters:
        presentation - The presentation.
        attributeMetaData - The attribute meta data, or null if not applicable.
        selectionMetaData - The selection meta data, or null if not applicable.
        sortMetaData - The sort meta data, or null if not applicable.

    • Method Detail

      • close

        public void close()
                   throws ResourceException
        Deprecated. 
        Closes the list. No further resources can be loaded. The list must be closed in order to clean up resources appropriately. This method has no effect if the list is already closed. This method fires a listClosed() ResourceListEvent.
        Overrides:
        close in class ResourceList
        Throws:
        ResourceException - If an error occurs.
      • fireResourceAdded

        protected void fireResourceAdded(Resource resource,
                             long index)
        Deprecated. 
        Fires a resourceAdded() ResourceListEvent.
        Overrides:
        fireResourceAdded in class ResourceList
        Parameters:
        resource - The resource.
        index - The index.
      • getNumberOfPages

        public int getNumberOfPages()
        Deprecated. 
        Returns the number of pages in the list buffer.
        Returns:
        The number of pages in the list buffer.
      • getPageSize

        public int getPageSize()
        Deprecated. 
        Returns the page size of the list buffer.
        Returns:
        The page size, in number of resources, of the list buffer.
      • isResourceAvailable

        public boolean isResourceAvailable(long index)
                                    throws ResourceException
        Deprecated. 
        Indicates if the resource is available. This means that the resource has been loaded.
        Overrides:
        isResourceAvailable in class ResourceList
        Parameters:
        index - The index.
        Returns:
        true if the resource is available, false if the resource is not available or the list is not open.
        Throws:
        ResourceException - If an error occurs.
      • open

        public void open()
                  throws ResourceException
        Deprecated. 
        Opens the list. The list must be open in order to perform most operations. This method has no effect if the list is already opened.
        Overrides:
        open in class ResourceList
        Throws:
        ResourceException - If an error occurs.
      • resourceAt

        public Resource resourceAt(long index)
                            throws ResourceException
        Deprecated. 
        Returns the resource specified by the index.

        This will implicitly open the list if needed.

        Overrides:
        resourceAt in class ResourceList
        Parameters:
        index - The index.
        Returns:
        The resource specified by the index, or null if the resource is not yet available.
        Throws:
        ResourceException - If an error occurs.
      • setNumberOfPages

        public void setNumberOfPages(int numberOfPages)
        Deprecated. 
        Sets the number of pages in the list buffer. This cannot be set when the list is open.
        Parameters:
        numberOfPages - The number of pages.
      • setPageSize

        public void setPageSize(int pageSize)
        Deprecated. 
        Sets the page size of the list buffer. This cannot be set when the list is open.
        Parameters:
        pageSize - The page size, in number of resources.