hasCardinality()

Determines if the attribute has the same cardinality as a specified cardinality value, given the attribute's name or its position in the business object's attribute list.

Syntax

public boolean hasCardinality(String attrName, String card);
public boolean hasCardinality(int position, String card);

Parameters

attrName
Is the name of an attribute whose cardinality is tested.
card
Is the cardinality value to use for checking. Valid cardinality values are:
1 - single cardinality
n - multiple cardinality
position
Is an integer that specifies the ordinal position of an attribute in the business object's attribute list.

Return values

Returns true if the cardinality of the attribute matches the specified value; otherwise, returns false.

Exceptions

AttributeNotFoundException
Thrown if the position or name specified is not valid for the definition of this business object.

Notes

This method is used to test cardinality of complex attributes (subobjects and arrays).

See also

getCardinality(),, isMultipleCard()

Copyright IBM Corporation 1997, 2004. All Rights Reserved.