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

com.ibm.xtools.patterns.framework

Class AbstractPatternDependency

+-- Object
      +-- AbstractPatternDependency

abstract public Class AbstractPatternDependency
extends Object
implements Observer

Represents a dependency between two pattern parameters.

The dependent pattern parameter depends on the dependency parameter. It observes the dependency parameter and notifies the dependent parameter under the various state-triggered update methods.

A dependency specifies that a set of elements requires the presence of another set of elements for implementation and functioning. The dependency is a relationship between two elements, asupplier element and a client element. A change to the supplier can affect the information needed by the other element, the client.

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.


Constructor summary
AbstractPatternDependency()

The default constructor for AbstractPatternDependency class that is provided automatically by the compiler.

Method summary
voidaccept(Visitor visitor)

Enables visitation of this entity.

voidupdate(Observable observable, Object value)

Updates the observable value of the pattern parameter.

booleanupdate(PatternParameterValue.Added dependent, PatternParameterValue.Maintained dependency)

Updates the dependency by adding the new dependent parameter value.

booleanupdate(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency)

Updates the dependency by adding the dependent parameter values as provided.

booleanupdate(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency)

Updates dependency using the dependent and dependency parameter values as provided.

booleanupdate(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency)

Updates the dependency by removing the dependent parameter values as provided.

booleanupdate(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency)

Updates the dependency by replacing the dependent parameter values as provided.

booleanupdate(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency)

Updates the dependency by removing the dependent parameter values as provided.

booleanupdate(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency)

Updates the dependency by replacing the dependent parameter values as provided.

booleanupdate(PatternParameterValue dependent, PatternParameterValue dependency)

Updates the dependency using the dependent and dependency values as provided.

booleanupdatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Added dependent)

Updates the pattern instance with the dependent parameter value that was added in the current state.

booleanupdatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Maintained dependent)

Updates the pattern instance with the dependent parameter value being generated with the current state.

booleanupdatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Removed dependent)

Updates the pattern instance with the dependent parameter value that was removed in the current state.

booleanupdatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Replaced dependent)

Updates the pattern instance with the dependent parameter value that was replaced in the current state.

Constructor detail

AbstractPatternDependency

public AbstractPatternDependency()

The default constructor for AbstractPatternDependency class that is provided automatically by the compiler.


Method detail

accept

public void accept(Visitor visitor)

Enables visitation of this entity.

Parameters:

visitor
- The visitor of the entity.

update

final public void update(Observable observable, Object value)

Updates the observable value of the pattern parameter.

Parameters:

observable
- A value of observable.
value
- The observable value of the pattern parameter.

update

public boolean update(PatternParameterValue.Added dependent, PatternParameterValue.Maintained dependency)

Updates the dependency by adding the new dependent parameter value.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true.

Parameters:

dependent
- The dependent parameter value to be added.
dependency
- The dependency parameter value to be maintained.

Returns:

A boolean value of true if the dependent parameter value is added. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency)

Updates the dependency by adding the dependent parameter values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true.

Parameters:

dependent
- The dependent parameter value to be maintained.
dependency
- The dependency parameter value to be added.

Returns:

A boolean value of true if the dependency parameter value is added. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency)

Updates dependency using the dependent and dependency parameter values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true.

Parameters:

dependent
- The dependent parameter value to be maintained.
dependency
- The dependency parameter value to be maintained.

Returns:

A boolean value of true if the dependent and dependency values are maintained. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency)

Updates the dependency by removing the dependent parameter values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true. To support remove behavior in pattern implementations this method is overridden. In most cases the implementation of this method is like the method variant with the types transposed.

Parameters:

dependent
- The dependent parameter value to be maintained.
dependency
- The dependency parameter value to be removed.

Returns:

A boolean value of true if the dependency parameter value is removed. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency)

Updates the dependency by replacing the dependent parameter values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true. To support replace behavior in pattern implementations this method is overridden. In most cases the implementation of this method is like the method variant with the types transposed.

Parameters:

dependent
- The dependent parameter value to be maintained.
dependency
- The dependency parameter value to be replaced.

Returns:

A boolean value of true if the dependency parameter value is replaced. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency)

Updates the dependency by removing the dependent parameter values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true. To support remove behavior in pattern implementations this method is overridden. In most cases the implementation of this method is like the method variant with the types transposed.

Parameters:

dependent
- The dependent parameter value to be removed.
dependency
- The dependency parameter value to be maintained, not added or removed.

Returns:

A boolean value of true if the dependent parameter value is removed. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency)

Updates the dependency by replacing the dependent parameter values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true. To support replace behavior in pattern implementations this method is overridden. In most cases the implementation of this method is like the method variant with the types transposed.

Parameters:

dependent
- The dependent parameter value to be replaced.
dependency
- The dependency parameter value to be maintained, not added or removed.

Returns:

A boolean value of true if the dependent parameter value is replaced. Otherwise, it returns a value of false.

update

public boolean update(PatternParameterValue dependent, PatternParameterValue dependency)

Updates the dependency using the dependent and dependency values as provided.

This is a hot-spot method. If not overridden, the default behavior is to return a value of true.

Parameters:

dependent
- The dependent parameter value.
dependency
- The dependency parameter value.

Returns:

A boolean value of true if the values are implemented. Otherwise, it returns a value of false.

updatePattern

final public boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Added dependent)

Updates the pattern instance with the dependent parameter value that was added in the current state.

Parameters:

owningInstance
- The instance that qualifies the exact parameter values.
dependent
- The dependent parameter value to be added.

Returns:

A boolean value of true if the new dependent parameter value is added. Otherwise, it returns a value of false.

updatePattern

final public boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Maintained dependent)

Updates the pattern instance with the dependent parameter value being generated with the current state.

Parameters:

owningInstance
- The instance that qualifies the exact parameter values.
dependent
- The dependent parameter value to be maintained.

Returns:

A boolean value of true if the dependent parameter value is maintained. Otherwise, it returns a value of false.

updatePattern

final public boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Removed dependent)

Updates the pattern instance with the dependent parameter value that was removed in the current state.

Parameters:

owningInstance
- The instance that qualifies the exact parameter values.
dependent
- The dependent parameter value to be removed.

Returns:

A boolean value of true if the dependent parameter value is removed. Otherwise, it returns a value of false.

updatePattern

final public boolean updatePattern(AbstractPatternInstance owningInstance, PatternParameterValue.Replaced dependent)

Updates the pattern instance with the dependent parameter value that was replaced in the current state.

Parameters:

owningInstance
- The instance that qualifies the exact parameter values.
dependent
- The dependent parameter value to be replaced.

Returns:

A boolean value of true if the dependent parameter value is replaced. Otherwise, it returns a value of false.


Feedback