maxBusObjArray()

Returns the business objects that have the maximum value for the specified attribute, as a business object array (BusObjArray object).

Syntax

BusObjArray maxBusObjArray(String attr)
 

Parameters

attr
A String, LongText, int, float, or double variable that refers to an attribute in a business object in the business object array.

Returns

A list of business objects in the form of BusObjArray or null.

Exceptions

UnknownAttributeException - When the specified attribute is not a valid attribute in the business objects passed in.

UnsupportedAttributeTypeException - When the type of the specified attribute is not one of the supported attribute types listed in the note section.

All of the above exceptions are subclassed from CollaborationException. The maxBusObjArray() method can set the following exception type for these exceptions: AttributeException.

Notes

The maxBusObjArray() method finds one or more business objects with the maximum value for the specified attribute, and returns these business objects in a BusObjArray object.

For example, suppose that this is a business object array containing Employee business objects and that the input argument is the attribute Salary, a Float. The method determines the largest value for Salary in all the Employee business objects and returns the business object that contains that value. If multiple business objects have that largest Salary value, the method returns all of those business objects.

A business object is ignored if the specified attribute contains null. If the value is null in all business objects in the array, null is returned.

When the attribute is of type String, the method returns the longest string lexically.

Examples

BusObjArray boarrayWithMaxSalary = items.maxBusObjArray("Salary");
 

Copyright IBM Corp. 2003, 2004