IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class AbstractPatternDependency

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.AbstractPatternDependency
All Implemented Interfaces:
Observer, Visitable

public abstract class AbstractPatternDependency
extends Object
implements Observer, Visitable

This class represents a dependency between two pattern parameters, the dependent pattern parameter dependent on the dependency parameter. It observes the dependency parameter and notifies the dependent parameter under the various state-triggered update methods. A pattern parameter dependency is typically associated with a pattern parameter by instantiating a dependency within the constructor of a pattern parameter. Dependencies are stored and managed within the abstract pattern parameter class. This class needs to be subclassed by a concrete dependency implementation that can then override the defined hot-spots to alter the dependency run-time behavior. By default, the hot-spots can be found by examining which methods are not marked final. In this class, the hot-spots are primarily the variants of the overloaded update method.

See Also:
update(PatternParameterValue, PatternParameterValue), update(PatternParameterValue.Added, PatternParameterValue.Maintained), update(PatternParameterValue.Maintained, PatternParameterValue.Added), update(PatternParameterValue.Removed, PatternParameterValue.Maintained), update(PatternParameterValue.Maintained, PatternParameterValue.Removed), update(PatternParameterValue.Maintained, PatternParameterValue.Maintained)

Constructor Summary
protected AbstractPatternDependency(AbstractPatternParameter dependent, AbstractPatternParameter dependency)
          Constructs an abstract pattern dependency class with the dependent and dependency parameters as given.
 
Method Summary
 void accept(Visitor visitor)
          Enable visitation of this entity.
protected  void initialize()
          A hot-spot method that is defaulted with no implementation.
 void update(Observable observable, Object value)
           
 boolean update(PatternParameterValue.Added dependent, PatternParameterValue.Maintained dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean update(PatternParameterValue dependent, PatternParameterValue dependency)
          Update the dependency using the dependent and dependency values as provided.
 boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Added dependent)
          Update the dependency with the dependency parameter being generated with the current state.
 boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Maintained dependent)
          Update the dependency with the dependency parameter being generated with the current state.
 boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Removed dependent)
          Update the dependency with the dependency parameter being generated with the current state.
 boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Replaced dependent)
          Update the dependency with the dependency parameter being generated with the current state.
protected  boolean updatePattern(PatternParameterValue.Added dependent, PatternParameterValue.Maintained dependency)
          Update the dependency with the given dependent and dependency parameter values.
protected  boolean updatePattern(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency)
          Update the dependency with the given dependent and dependency parameter values.
protected  boolean updatePattern(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency)
          Update the dependency with the given dependent and dependency parameter values.
protected  boolean updatePattern(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency)
          Update the dependency with the given dependent and dependency parameter values.
protected  boolean updatePattern(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency)
          Update the dependency with the given dependent and dependency parameter values.
protected  boolean updatePattern(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency)
          Update the dependency with the given dependent and dependency parameter values.
protected  boolean updatePattern(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency)
          Update the dependency with the given dependent and dependency parameter values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPatternDependency

protected AbstractPatternDependency(AbstractPatternParameter dependent,
                                    AbstractPatternParameter dependency)
Constructs an abstract pattern dependency class with the dependent and dependency parameters as given. The parameters are updated with this dependency information as well by invoking the appropriate add methods.

Parameters:
dependent - the dependent pattern parameter for this dependency
dependency - the dependency pattern parameter for this dependency
See Also:
AbstractPatternParameter#addDependency(AbstractPatternDependency), AbstractPatternParameter#addObserver(Observer)
Method Detail

accept

public void accept(Visitor visitor)
Enable visitation of this entity.

Specified by:
accept in interface Visitable

initialize

protected void initialize()
A hot-spot method that is defaulted with no implementation. It is recommended that all custom pattern dependency constructor code be put in the pattern dependency initialize method rather than in the constructor. This method will be invoked after a pattern parameter that owns the dependency has been initialized.


update

public final void update(Observable observable,
                         Object value)
Specified by:
update in interface Observer

update

public boolean update(PatternParameterValue dependent,
                      PatternParameterValue dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to do nothing more than return true.

Parameters:
dependent - the dependent parameter value
dependency - the depenency parameter value
Returns:
indicates if notification of dependents should continue

update

public boolean update(PatternParameterValue.Added dependent,
                      PatternParameterValue.Maintained dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to call into the more general update method variant.

Parameters:
dependent - the dependent parameter value
dependency - the depenency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue, PatternParameterValue)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Added dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to call into the more general update method variant.

Parameters:
dependent - the dependent parameter value
dependency - the depenency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue, PatternParameterValue)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Maintained dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to call into the more general update method variant.

Parameters:
dependent - the dependent parameter value
dependency - the depenency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue, PatternParameterValue)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Removed dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to do nothing more than return true. To support remove behavior in pattern implementations this method woul be overridden. In most cases the implementation of this method would be very much like the method variant with the types transposed.

Parameters:
dependent - the dependent parameter value
dependency - the depenency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue.Removed, PatternParameterValue.Maintained)

update

public boolean update(PatternParameterValue.Removed dependent,
                      PatternParameterValue.Maintained dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to do nothing more than return true. To support remove behavior in pattern implementations this method would be overridden. In most cases the implementation of this method would be very much like the method variant with the types transposed.

Parameters:
dependent - the dependent parameter value
dependency - the depenency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue.Maintained, PatternParameterValue.Removed)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Replaced dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to do nothing more than return true. To support replace behavior in pattern implementations this method would be overridden. In most cases the implementation of this method would be very much like the method variant with the types transposed.

Parameters:
dependent - the dependent parameter value
dependency - the dependency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue.Removed, PatternParameterValue.Maintained)

update

public boolean update(PatternParameterValue.Replaced dependent,
                      PatternParameterValue.Maintained dependency)
Update the dependency using the dependent and dependency values as provided. This is a hot-spot method and the default behavior if not overridden is to do nothing more than return true. To support replace behavior in pattern implementations this method would be overridden. In most cases the implementation of this method would be very much like the method variant with the types transposed.

Parameters:
dependent - the dependent parameter value
dependency - the dependency parameter value
Returns:
indicates if notification of dependents should continue
See Also:
update(PatternParameterValue.Maintained, PatternParameterValue.Removed)

updatePattern

public final boolean updatePattern(AbstractPatternInstance owningInstance,
                                   PatternParameterValue.Added dependent)
Update the dependency with the dependency parameter being generated with the current state.

Parameters:
owningInstance - the instance that qualifies the exact parameter values
dependent - the dependent parameter value
Returns:
indicates if notification of dependents should continue

updatePattern

public final boolean updatePattern(AbstractPatternInstance owningInstance,
                                   PatternParameterValue.Maintained dependent)
Update the dependency with the dependency parameter being generated with the current state.

Parameters:
owningInstance - the instance that qualifies the exact parameter values
dependent - the dependent parameter value
Returns:
indicates if notification of dependents should continue

updatePattern

public final boolean updatePattern(AbstractPatternInstance owningInstance,
                                   PatternParameterValue.Removed dependent)
Update the dependency with the dependency parameter being generated with the current state.

Parameters:
owningInstance - the instance that qualifies the exact parameter values
dependent - the dependent parameter value
Returns:
indicates if notification of dependents should continue

updatePattern

public final boolean updatePattern(AbstractPatternInstance owningInstance,
                                   PatternParameterValue.Replaced dependent)
Update the dependency with the dependency parameter being generated with the current state.

Parameters:
owningInstance - the instance that qualifies the exact parameter values
dependent - the dependent parameter value
Returns:
indicates if notification of dependents should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Added dependent,
                                      PatternParameterValue.Maintained dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Maintained dependent,
                                      PatternParameterValue.Added dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Maintained dependent,
                                      PatternParameterValue.Maintained dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Maintained dependent,
                                      PatternParameterValue.Removed dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Removed dependent,
                                      PatternParameterValue.Maintained dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Replaced dependent,
                                      PatternParameterValue.Maintained dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

updatePattern

protected final boolean updatePattern(PatternParameterValue.Maintained dependent,
                                      PatternParameterValue.Replaced dependency)
Update the dependency with the given dependent and dependency parameter values. This is not a hot-spot method and cannot be overridden; it defines the base framework behavior which then has callouts to the hot-spot methods. This is a template method with the steps in the template being implemented by hot-spot methods that can be overridden. The values are unraveled into singular values for each parameter's values and then dependency delegates are invoked. After all delegates are invoked this dependency's update hot-spot method is called. This method is implemented one time for each interesting pattern parameter value in order to protect the direct type of the value. If parameterized methods are supposed in the language eventually, this can be converted to use that feature and then reduce the amount of redundant code.

Parameters:
dependent - the dependent parameter value in this dependency
dependency - the dependency parameter value in this dependency
Returns:
indicates whether notification should continue

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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