org.omwg.mediation.language.objectModel
Class MappingRule

java.lang.Object
  extended by org.omwg.mediation.language.objectModel.MappingRule

public class MappingRule
extends java.lang.Object

Class for a mapping rule, represented by an id and a directive.

Version:
$Revision: 1.6 $ $Date: 2005/06/20 09:26:14 $
Author:
Francois Scharffe, Adrian Mocan Created on 24-Mar-2005 Committed by $Author: grahamhench $ $Source: /cvsroot/dome//dome/src/org/omwg/mediation/language/objectModel/MappingRule.java,v $,

Field Summary
 boolean directionality
          Represents a flag that indicates whether the mapping rules is unidirectional or bidirectional.
 
Constructor Summary
MappingRule()
          Creates a new empty mapping rule.
MappingRule(boolean directionality)
          Construct a mapping rule object having a specified id and the indicated directionality.
 
Method Summary
 void addAnnotation(Annotation annotation)
          Attributes a collection of annotations of the mapping rule
 void addCondition(Condition condition)
          Adds a condition (with value) to a new conditions array (collection), if the conditions array (collection) is empty
 void addLogicalExpressions(LogicalExpression logicalExpression)
          Adds a logical expression (with value) to a new logical expression array (collection), if the logical expression array (collection) is empty
 java.lang.Object clone()
          Clones the curent object.
 Annotation getAnnotation(int num)
          Returns the annotation specified by the reference number (int param)
 java.util.Collection getAnnotations()
          Returns entire collection of annotations when predefined
 java.util.Collection getConditions()
          Returns a collection of the conditions of the mapping rule
 boolean getDirectionality()
          Returns the directionality of the mapping rule when predefined(unidirectionality: false & bidirectionality: true)
 java.util.Collection getLogicalExpressions()
          Returns a collection of the logical expressions of the mapping rule
 Expression getSource()
          Returns the expression from the source ontology when predefined
 Expression getTarget()
          Returns the expression from the target onotolgy when predefined
 void setAnnotations(java.util.Collection annotations)
          Attributes a collection of annotations of the mapping rule
 void setConditions(java.util.Collection conditions)
          Attributes a collection of the conditions of the mapping rule
 void setDirectionality(boolean directionality)
          Sets the directionality of the mapping rule (unidirectionality: false & bidirectionality: true)
 void setLogicalExpressions(java.util.Collection logicalExpressions)
          Attributes a collection of the logical expressions of the mapping rule
 void setSource(Expression source)
          Sets the source ontology expression
 void setTarget(Expression target)
          Sets the target ontology expression
 java.lang.String toString()
          Provides a serialization for MappingRule objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

directionality

public boolean directionality

Represents a flag that indicates whether the mapping rules is unidirectional or bidirectional. Individual mappings are always bidirectional

Constructor Detail

MappingRule

public MappingRule()

Creates a new empty mapping rule.


MappingRule

public MappingRule(boolean directionality)

Construct a mapping rule object having a specified id and the indicated directionality.

Parameters:
directionality - indicates whether the mapping rule is one-way (directionality: false) or two-way (directionality: true)

Method Detail

clone

public java.lang.Object clone()

Clones the curent object.

Overrides:
clone in class java.lang.Object
Returns:
a cloned object of this

toString

public java.lang.String toString()

Provides a serialization for MappingRule objects.

Overrides:
toString in class java.lang.Object
Returns:
str (a string containing the serialized object)

getSource

public Expression getSource()

Returns the expression from the source ontology when predefined

Returns:
source (expression from the source ontology)

setSource

public void setSource(Expression source)

Sets the source ontology expression

Parameters:
source - (expression from the source ontology)

getTarget

public Expression getTarget()

Returns the expression from the target onotolgy when predefined

Returns:
target (expression from the target ontology)

setTarget

public void setTarget(Expression target)

Sets the target ontology expression

Parameters:
target - (expression from the target ontology)

getDirectionality

public boolean getDirectionality()

Returns the directionality of the mapping rule when predefined(unidirectionality: false & bidirectionality: true)

Returns:
directionality (of the mapping rule)

setDirectionality

public void setDirectionality(boolean directionality)

Sets the directionality of the mapping rule (unidirectionality: false & bidirectionality: true)

Parameters:
directionality - (of the mapping)

getAnnotations

public java.util.Collection getAnnotations()

Returns entire collection of annotations when predefined

Returns:
annotations (entire collection)

setAnnotations

public void setAnnotations(java.util.Collection annotations)

Attributes a collection of annotations of the mapping rule

Parameters:
annotations - (entire collection)

addAnnotation

public void addAnnotation(Annotation annotation)

Attributes a collection of annotations of the mapping rule

Parameters:
annotation - (entire collection)

getConditions

public java.util.Collection getConditions()

Returns a collection of the conditions of the mapping rule

Returns:
conditions (entire collection)

setConditions

public void setConditions(java.util.Collection conditions)

Attributes a collection of the conditions of the mapping rule

Parameters:
conditions - (entire collection)

getLogicalExpressions

public java.util.Collection getLogicalExpressions()

Returns a collection of the logical expressions of the mapping rule

Returns:
logicalExpression (entire collection)

setLogicalExpressions

public void setLogicalExpressions(java.util.Collection logicalExpressions)

Attributes a collection of the logical expressions of the mapping rule

Parameters:
logicalExpressions - (entire collection)

addCondition

public void addCondition(Condition condition)

Adds a condition (with value) to a new conditions array (collection), if the conditions array (collection) is empty

Parameters:
condition -

addLogicalExpressions

public void addLogicalExpressions(LogicalExpression logicalExpression)

Adds a logical expression (with value) to a new logical expression array (collection), if the logical expression array (collection) is empty

Parameters:
logicalExpression -

getAnnotation

public Annotation getAnnotation(int num)

Returns the annotation specified by the reference number (int param)

Parameters:
num - (number referencing specific annotation in annotation list/collection)
Returns:
the referred annotation