| Java API Reference | Class Hierarchy | All Classes | All Fields and Methods |
com.ibm.xtools.patterns.framework
+-- AbstractParameterArgument +-- PatternParameterValue +-- PatternParameterValue.Replaced
final static public Class PatternParameterValue.Replaced
extends PatternParameterValue
The Replaced subclass of the pattern parameter value represents the state of when a pattern parameter value is replaced by one or more values.
| Constructor summary |
|---|
| PatternParameterValue.Replaced(AbstractPatternInstance owningInstance, AbstractPatternParameter parameter, AbstractParameterArgument argument, AbstractParameterArgument replacement) Constructs a replaced pattern parameter value. |
| Method summary | |
|---|---|
| void | accept(PatternParameterValue.Consumer consumer) An abstract method that is implemented in the subclasses such as added, removed, maintained or proposed. |
| PatternParameterValue.Added | asAdded() Produces a new added value from this replaced value's state (the replacement values only). |
| PatternParameterValue.Removed | asRemoved() Produces a new removed value from this replaced value's state (the values and not the replacement values). |
| void | enumerate(PatternParameterValue.Consumer consumer) Enumerate through all the replaced values contained within this replaced pattern parameter value instance. |
| AbstractParameterArgument | getReplacement() Gets the replacement argument as a singular value, if multiple replacements are stored only the first is returned. |
| AbstractParameterArgument | getReplacements() Gets the replacement arguments as a multivalue. |
| boolean | hasMultipleReplacements() Determine if this replaced pattern parameter value has multiple replacement arguments. |
| boolean | hasSingleReplacement() Determine if this replaced pattern parameter value has a single replacement argument. |
| Methods inherited from PatternParameterValue | |
|---|---|
| accept, getArgument, getArguments, getImage, getMetatype, getOwningInstance, getOwningParameter, getValue, getValues, hasValue, hasValues, isValueFor | |
Constructor detail
public PatternParameterValue.Replaced(AbstractPatternInstance owningInstance, AbstractPatternParameter parameter, AbstractParameterArgument argument, AbstractParameterArgument replacement)
Constructs a replaced pattern parameter value.
Parameters:
| owningInstance | - the owning pattern instance |
| parameter | - the owning or related pattern parameter value |
| argument | - the argument replaced in this replaced pattern parameter value |
| replacement | - the argument supplied as the replacement in this replaced pattern parameter value |
Method detail
public void accept(PatternParameterValue.Consumer consumer)
An abstract method that is implemented in the subclasses such as added, removed, maintained or proposed.
Parameters:
| consumer | - |
public PatternParameterValue.Added asAdded()
Produces a new added value from this replaced value's state (the replacement values only).
Returns:
a new pattern parameter value with different identity as a different instance but with the same state underneath |
public PatternParameterValue.Removed asRemoved()
Produces a new removed value from this replaced value's state (the values and not the replacement values).
Returns:
a new pattern parameter value with different identity as a different instance but with the same state underneath |
public void enumerate(PatternParameterValue.Consumer consumer)
Enumerate through all the replaced values contained within this replaced pattern parameter value instance.
Parameters:
| consumer | - the consumer which is called back for each replaced pattern parameter value to be consumed |
public AbstractParameterArgument getReplacement()
Gets the replacement argument as a singular value, if multiple replacements are stored only the first is returned.
Returns:
the first replacement argument of the replacement array |
public AbstractParameterArgument getReplacements()
Gets the replacement arguments as a multivalue.
Returns:
returns the replacement arguments as an array |