org.omwg.mediation.language.objectModel
Class AttributeExpr

java.lang.Object
  extended by org.omwg.mediation.language.objectModel.Expression
      extended by org.omwg.mediation.language.objectModel.AttributeExpr

public class AttributeExpr
extends Expression

Extends Expression - constructs a relation expression consisting of either an Id, an expression definition, or an array list of sub-expressions and a string representation (operator)

Version:
$Revision: 1.4 $ $Date: 2005/06/20 09:54:04 $
Author:
Francois Scharffe, Adrian Mocan Created on 23-Mar-2005 Committed by $Author: grahamhench $ $Source: /cvsroot/dome//dome/src/org/omwg/mediation/language/objectModel/AttributeExpr.java,v $,

Field Summary
 
Fields inherited from class org.omwg.mediation.language.objectModel.Expression
AND_OPERATOR, INVERSE_OPERATOR, JOIN_OPERATOR, NOT_OPERATOR, OR_OPERATOR, REFLEXIVE_OPERATOR, SYMMETRIC_OPERATOR, TRANS_OPERATOR
 
Constructor Summary
AttributeExpr(java.util.ArrayList subExpressions, java.lang.String operator)
          Constructs an attribute expression object with an array list of sub-expressions and a string representation (operator)
AttributeExpr(Id id)
          Constructs an attribute expression object with an id
 
Method Summary
 boolean addExpression(AttributeExpr expression)
          Sends the attribute expression to the Expression class.
 boolean addExpression(AttributeExpr expression, int index)
          Sends the attribute expression and index to the Expression class.
 java.lang.Object clone()
          Copies the attributeExpr object
 Expression getSubExpression(int index)
          Returns the specific attribute expression definition from the array list of sub-expressions when the attribute expression is complex.
 java.util.ArrayList getSubExpressionsList()
          Returns the array list of sub-expressions when the attribute expression is complex.
 
Methods inherited from class org.omwg.mediation.language.objectModel.Expression
getId, getOperator, isComplexExpression, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeExpr

public AttributeExpr(Id id)

Constructs an attribute expression object with an id

Parameters:
id -

AttributeExpr

public AttributeExpr(java.util.ArrayList subExpressions,
                     java.lang.String operator)

Constructs an attribute expression object with an array list of sub-expressions and a string representation (operator)

Parameters:
subExpressions - (array list of sub-expressions)
operator - (string type)
Method Detail

getSubExpressionsList

public java.util.ArrayList getSubExpressionsList()

Returns the array list of sub-expressions when the attribute expression is complex. Otherwise, returns null

Specified by:
getSubExpressionsList in class Expression
Returns:
attributeExpressionList (array list)

getSubExpression

public Expression getSubExpression(int index)

Returns the specific attribute expression definition from the array list of sub-expressions when the attribute expression is complex. If not, or if the integer parameter (index) is out of bounds, then the method returns null

Specified by:
getSubExpression in class Expression
Parameters:
index - (int type)
Returns:
attribute expression definition

addExpression

public boolean addExpression(AttributeExpr expression)

Sends the attribute expression to the Expression class. Adds expression to a complex expression, if the sub-expression array list is not empty - then returns true. Otherwise returns false.

Parameters:
expression - (AttributeExpr object)
Returns:
boolean (true, if expression is added - false if not)

addExpression

public boolean addExpression(AttributeExpr expression,
                             int index)

Sends the attribute expression and index to the Expression class. Adds expression to a complex expression. If the index is negative or greater than the size of the sub-expression array list, then false is returned. If the sub-expression array list is not empty - then returns true. Otherwise returns false.

Parameters:
expression - (AttributeExpr object)
index - (int type)
Returns:
boolean (true, if expression is added - false if not)

clone

public java.lang.Object clone()

Copies the attributeExpr object

Specified by:
clone in class Expression
Returns:
new attributeExpr object