com.ibm.gre.samples.collectionhelpers
Class IRMList

java.lang.Object
  |
  +--com.ibm.gre.samples.collectionhelpers.IRMList

public class IRMList
extends java.lang.Object

Encapsulates a Records Manager Item List. Provides methods for getting attribute values. Also methods for removing specified Items.


Constructor Summary
IRMList(java.lang.String xmlList, java.lang.String strPrimaryKeyAttributeName, java.lang.String strCaptionAttributeName)
          Constructor
 
Method Summary
 java.lang.String getAttributeValue(int index, java.lang.String attrName)
          Gets the value for the named attribute at the specified index.
 java.lang.String getCaption(int index)
          Returns the "Caption" value for the specified Item.
 int getCount()
          Returns the number of Item elements in the List.
 java.lang.String getPrimaryKey(int index)
          Returns the "Primary Key" value for the specified Item.
 java.lang.String getXML()
          Returns the current value for the underlying XML for this List.
 void removeItem(int index)
          Removes the Item element at the specified index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IRMList

public IRMList(java.lang.String xmlList,
               java.lang.String strPrimaryKeyAttributeName,
               java.lang.String strCaptionAttributeName)
        throws com.ibm.gre.engine.util.RecordManagerException
Constructor

Parameters:
xmlList - A Records Manager List Item type XML String. See any Records Manager List method for an example of this type of XML.
strPrimaryKeyAttributeName - The name of the attribute that you wish to consider as the "Primary Key" for this List. The value of this attribute is returned by the PrimaryKey getter method.
strCaptionAttributeName - The name of the attribute that you wish to consider as the "Caption" for this list. The value of this attribute is returned by the Caption getter method.
Throws:
com.ibm.gre.engine.util.RecordManagerException
Method Detail

getXML

public java.lang.String getXML()
Returns the current value for the underlying XML for this List.

Returns:
String

getCount

public int getCount()
Returns the number of Item elements in the List.


getPrimaryKey

public java.lang.String getPrimaryKey(int index)
                               throws java.lang.Exception
Returns the "Primary Key" value for the specified Item. The attribute that you wish to designate as the "Primary Key" is set in the constructor for this object.

Parameters:
index - The index of specifying the Item to return the "Primary Key" for.
Returns:
The value of the "Primary Key".
java.lang.Exception

getCaption

public java.lang.String getCaption(int index)
                            throws java.lang.Exception
Returns the "Caption" value for the specified Item. The attribute that you wish to designate as the "Caption" is set in the constructor for this object.

Parameters:
index - The index of specifying the Item to return the "Caption" for.
Returns:
The value for the "Caption"
Throws:
java.lang.Exception

getAttributeValue

public java.lang.String getAttributeValue(int index,
                                          java.lang.String attrName)
                                   throws java.lang.Exception
Gets the value for the named attribute at the specified index.

Parameters:
index - The index of the Item to return the attribute value for.
attrName - The name of the attribute to return the value for.
Returns:
Value of the specified attribute.
Throws:
java.lang.Exception

removeItem

public void removeItem(int index)
Removes the Item element at the specified index.

Parameters:
index - The index of the Item element to remove.