| Java API Reference | Class Hierarchy | All Classes | All Fields and Methods |
com.ibm.xtools.patterns.framework
+-- Object +-- PatternMultiplicity
public Class PatternMultiplicity
extends Object
Used to indicate multiplicity.
This is the framework implementation of the multiplicity class that specializes the pattern service version.
| Constructor summary |
|---|
| PatternMultiplicity(int upperBound) Constructs a new pattern multiplicity element given only an upper bound. |
| PatternMultiplicity(int lowerBound, int upperBound) Constructs a new pattern multiplicity element given a lower and upper bound. |
| PatternMultiplicity(String identifier) Constructs a new pattern multiplicity element given a string that will be parsed to set the pattern multiplicity internal state. |
| Method summary | |
|---|---|
| boolean | equals(Object object) Compares for equality through the default implementation of java.lang.Object.equals(Object). |
| int | getLowerBound() Returns the lower bound specified by this multiplicity object. |
| int | getUpperBound() Returns the upper bound specified by this multiplicity object. |
| int | hashCode() Retrieves the parameter hash code value. |
| boolean | isOptional() Indicates whether this multiplicity allows optionality, in other words, if the lower bound is zero or not. |
| boolean | isSatisfied(int valueCount) Determines if the multiplicity is satisfied with the input number of values that are associated with this multiplicity. |
| boolean | isSatisfied(int valueCount, PatternMultiplicity.BoundQualifier qualifier) Determines if the multiplicity is satisfied with the input number of values that are associated with this multiplicity. |
| boolean | isUnlimited() Indicates whether this multiplicity is unlimited. |
| String | toString() Retrieves the string to the value. |
Constructor detail
public PatternMultiplicity(int upperBound)
Constructs a new pattern multiplicity element given only an upper bound.
The lower bound is assumed to be one if unspecified. For example, a value of -1 indicates one to many instances allowed, same as "1..*".
Parameters:
| upperBound | - The upper bound on the multiplicity. |
public PatternMultiplicity(int lowerBound, int upperBound)
Constructs a new pattern multiplicity element given a lower and upper bound.
For example, a value of 0, -1 indicates zero to many instances allowed, same as "0..*".
Parameters:
| lowerBound | - The lower bound on the multiplicity. |
| upperBound | - The upper bound on the multiplicity. |
public PatternMultiplicity(String identifier)
Constructs a new pattern multiplicity element given a string that will be parsed to set the pattern multiplicity internal state.
Parameters:
| identifier | - The textual representation of the multiplicity. |
Method detail
public boolean equals(Object object)
Compares for equality through the default implementation of java.lang.Object.equals(Object).
Parameters:
| object | - The object to be compared. |
Returns:
A boolean value of true if the object is equal. Otherwise, it returns a value of false. |
public int getLowerBound()
Returns the lower bound specified by this multiplicity object.
Returns:
The lower bound of the multiplicity. |
public int getUpperBound()
Returns the upper bound specified by this multiplicity object.
Returns:
The upper bound of the multiplicity. |
public int hashCode()
Retrieves the parameter hash code value.
Returns:
An integer representing the value. |
public boolean isOptional()
Indicates whether this multiplicity allows optionality, in other words, if the lower bound is zero or not.
Returns:
Indicates optionality or not. |
public boolean isSatisfied(int valueCount)
Determines if the multiplicity is satisfied with the input number of values that are associated with this multiplicity.
Parameters:
| valueCount | - The number of values checked for multiplicity validity. |
Returns:
A boolean value of true if the multiplicity would be satisfied with the specified number of values. Otherwise, it returns a value of false. |
public boolean isSatisfied(int valueCount, PatternMultiplicity.BoundQualifier qualifier)
Determines if the multiplicity is satisfied with the input number of values that are associated with this multiplicity.
Parameters:
| valueCount | - The number of values. |
| qualifier | - A type-safe enumeration indicating lower or upper boundary only. |
Returns:
A boolean value of true if the multiplicity is satisfied with the specified number of values. Otherwise, it returns a value of false. |