Class ResourceListRowData

  • All Implemented Interfaces:

    public class ResourceListRowData
    extends RowData
    The ResourceListRowData class represents a resource list of data.

    The list of data is formatted into a series of rows where each row contains a finite number of columns determined by the number of column attribute ID's. Each column within a row contains an individual data item.

    A ResourceListRowData object can represent any implementation of the ResourceList interface. The row data columns are specified as an array of column attribute IDs. The row data will contain a column for each element of the array. The following can be specified as column attribute IDs:

    • null - The name from each Resource's Presentation object are presented in the column.
    • Resource attribute IDs - These are defined by the Resource objects that make up the rows data. The corresponding attribute value is presented in the column.

    A ResourceListRowData object maintains a position in the resource list that points to its current row of data. The initial position in the list is set before the first row. The next method moves to the next row in the list.

    The getObject method is used to retrieve the column value for the current row indexed by the column number. Columns are numbered starting from 0.

    The following example creates a ResourceListRowData object using an RUserList:

      // Create an object to represent the system.
      AS400 mySystem = new AS400("");
      // Create a resource user list.
      RUserList userList = new RUserList(sys);
      // Set the selection so that all user profiles
      // are included in the list.
      userList.setSelectionValue(RUserList.SELECTION_CRITERIA, RUserList.ALL);
      // Create an HTMLTableConverter object.
      HTMLTableConverter converter = new HTMLTableConverter();
      // Set up the table tag with a maximum of 20 rows per table.
      // Create an HTMLTable and use the meta data for the table headers.
      HTMLTable table = new HTMLTable();
      // Create a ResourceListRowData.
      ResourceListRowData rowdata = new ResourceListRowData(userList, new Object[] { null, RUser.TEXT_DESCRIPTION } );
      // Convert the ResourceListRowData into an HTMLTable.
      String[] html = converter.convert(rowdata);
      // Print out the first table of 20 users from the html array.
    See Also:
    Serialized Form
    • Constructor Detail

      • ResourceListRowData

        public ResourceListRowData()
        Constructs a default ResourceListRowData object.
      • ResourceListRowData

        public ResourceListRowData(ResourceList resourceList,
                           java.lang.Object[] columnAttributeIDs)
        Constructs a ResourceListRowData object with the specified resourceList and columnAttributeIDs.
        resourceList - The resource list.
        columnAttributeIDs - The array of column attributes.
        See Also:
    • Method Detail

      • getColumnAttributeIDs

        public java.lang.Object[] getColumnAttributeIDs()
        Returns the array of column attribute IDs.
        The column attribute IDs.
      • getObject

        public java.lang.Object getObject(int columnIndex)
                                   throws RowDataException
        Returns the current row's column data specified at columnIndex.
        getObject in class RowData
        columnIndex - The column index (0-based).
        The column object.
        RowDataException - If a row data error occurs.
      • getResourceList

        public ResourceList getResourceList()
        Return the resource list.
        The resource list.
      • length

        public int length()
        Returns the number of rows in the resource list.
        length in class RowData
        The number of rows.
      • setColumnAttributeIDs

        public void setColumnAttributeIDs(java.lang.Object[] columnAttributeIDs)
        Sets the resource list column attribute IDs.
        columnAttributeIDs - The column attribute IDs.
      • setResourceList

        public void setResourceList(ResourceList resourceList)
        Sets the resource list.
        resourceList - The resource list.
        See Also: