IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class PatternParameterValue.Replaced

java.lang.Object
  extended bycom.ibm.xtools.patterns.core.AbstractParameterArgument
      extended bycom.ibm.xtools.patterns.framework.PatternParameterValue
          extended bycom.ibm.xtools.patterns.framework.PatternParameterValue.Replaced
Enclosing class:
PatternParameterValue

public static final 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.


Nested Class Summary
 
Nested classes inherited from class com.ibm.xtools.patterns.framework.PatternParameterValue
PatternParameterValue.Added, PatternParameterValue.Maintained, PatternParameterValue.Proposed, PatternParameterValue.Removed, PatternParameterValue.Replaced, PatternParameterValue.Unresolved
 
Nested classes inherited from class com.ibm.xtools.patterns.core.AbstractParameterArgument
AbstractParameterArgument.Pair
 
Constructor Summary
PatternParameterValue.Replaced(AbstractPatternInstance owningInstance, AbstractPatternParameter parameter, AbstractParameterArgument argument, AbstractParameterArgument replacement)
          Constructs a replaced pattern parameter value.
PatternParameterValue.Replaced(AbstractPatternInstance owningInstance, AbstractPatternParameter parameter, AbstractParameterArgument argument, AbstractParameterArgument[] replacements)
          Constructs a replaced pattern parameter value.
 
Method Summary
 void accept(com.ibm.xtools.patterns.framework.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(com.ibm.xtools.patterns.framework.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 class com.ibm.xtools.patterns.framework.PatternParameterValue
getArgument, getArguments, getImage, getMetatype, getOwningInstance, getOwningParameter, getValue, getValues, hasValue, hasValues, isValueFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

PatternParameterValue.Replaced

public PatternParameterValue.Replaced(AbstractPatternInstance owningInstance,
                                      AbstractPatternParameter parameter,
                                      AbstractParameterArgument argument,
                                      AbstractParameterArgument[] replacements)
Constructs a replaced pattern parameter value.

Parameters:
owningInstance - the owning pattern instance
parameter - the owning or related pattern parameter value
argument - the argument to be wrapped by this replaced pattern parameter value
replacements - the arguments supplied as the replacements in this replaced pattern parameter value
Method Detail

accept

public void accept(com.ibm.xtools.patterns.framework.PatternParameterValue.Consumer consumer)
Description copied from class: PatternParameterValue
An abstract method that is implemented in the subclasses such as added, removed, maintained or proposed. It is a call me right back method that invokes the consumer providing the most direct type at run-time.

Specified by:
accept in class PatternParameterValue
Parameters:
consumer - the callback interface

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(com.ibm.xtools.patterns.framework.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. If only one argument is stored then an array of length one is returned.

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.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.