Java API ReferenceClass Hierarchy | All Classes | All Fields and Methods

com.ibm.xtools.patterns.framework

Class PatternParameterValue.Replaced

+-- 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.

Enclosing Class:


Constructor summary
PatternParameterValue.Replaced(AbstractPatternInstance owningInstance, AbstractPatternParameter parameter, AbstractParameterArgument argument, AbstractParameterArgument replacement)

Constructs a replaced pattern parameter value.

Method summary
voidaccept(PatternParameterValue.Consumer consumer)

An abstract method that is implemented in the subclasses such as added, removed, maintained or proposed.

PatternParameterValue.AddedasAdded()

Produces a new added value from this replaced value's state (the replacement values only).

PatternParameterValue.RemovedasRemoved()

Produces a new removed value from this replaced value's state (the values and not the replacement values).

voidenumerate(PatternParameterValue.Consumer consumer)

Enumerate through all the replaced values contained within this replaced pattern parameter value instance.

AbstractParameterArgumentgetReplacement()

Gets the replacement argument as a singular value, if multiple replacements are stored only the first is returned.

AbstractParameterArgumentgetReplacements()

Gets the replacement arguments as a multivalue.

booleanhasMultipleReplacements()

Determine if this replaced pattern parameter value has multiple replacement arguments.

booleanhasSingleReplacement()

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

PatternParameterValue.Replaced

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

accept

public void accept(PatternParameterValue.Consumer consumer)

An abstract method that is implemented in the subclasses such as added, removed, maintained or proposed.

Parameters:

consumer
-

asAdded

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

asRemoved

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

enumerate

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

getReplacement

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

getReplacements

public AbstractParameterArgument getReplacements()

Gets the replacement arguments as a multivalue.

Returns:

returns the replacement arguments as an array

hasMultipleReplacements

public boolean hasMultipleReplacements()

Determine if this replaced pattern parameter value has multiple replacement arguments.

Returns:

indicates whether or not multiple replacement arguments have been provided.

hasSingleReplacement

public boolean hasSingleReplacement()

Determine if this replaced pattern parameter value has a single replacement argument.

Returns:

indicates whether or not a single replacement argument has been provided.


Feedback