org.ocltf.translation
Class Expression

java.lang.Object
  extended byorg.ocltf.translation.Expression

public class Expression
extends java.lang.Object

Contains the translated expression,

Author:
Chad Brandon

Constructor Summary
Expression(java.lang.String originalExpression)
          Creates a new instance of this Expression object
 
Method Summary
 void appendSpaceToTranslatedExpression()
          Appends a space charater to the current translated expression String Buffer.
 void appendToTranslatedExpression(java.lang.Object object)
          Appends the value of the value of the object's toString result to the current translated expression String Buffer.
 java.lang.String getContextType()
          Returns the type which is the context of this expression.
 java.lang.String getKind()
          Returns the Kind of this Expression (inv, post, or pre)
 java.lang.String getName()
           
 java.lang.String getOriginalExpression()
          Returns the expression before translation.
 java.lang.String getTranslatedExpression()
          Returns the expression after translation.
 void insertInTranslatedExpression(int position, java.lang.Object object)
          Performs replacement of the value of the object's toString result at the start and end positions of the buffer containing the Expression.
 void replaceInTranslatedExpression(java.lang.String pattern, java.lang.String replacement)
          Replaces the pattern with the replacement within the translated expression buffer.
 void setContextType(java.lang.String contextType)
          Sets the context type (the type to which the expression applies --> the type declared after the 'context')
 void setKind(java.lang.String string)
          Sets the "kind" of the OCL contraint (i.e, "pre", "post", "inv")
 void setName(java.lang.String name)
          Sets the name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expression

public Expression(java.lang.String originalExpression)
Creates a new instance of this Expression object

Parameters:
originalExpression - - the OCL expression that will be translated.
Method Detail

appendToTranslatedExpression

public void appendToTranslatedExpression(java.lang.Object object)
Appends the value of the value of the object's toString result to the current translated expression String Buffer.

Parameters:
object - the object to append.

appendSpaceToTranslatedExpression

public void appendSpaceToTranslatedExpression()
Appends a space charater to the current translated expression String Buffer.


replaceInTranslatedExpression

public void replaceInTranslatedExpression(java.lang.String pattern,
                                          java.lang.String replacement)
Replaces the pattern with the replacement within the translated expression buffer.

Parameters:
pattern - the pattern to search for.
replacement - the replacement.

insertInTranslatedExpression

public void insertInTranslatedExpression(int position,
                                         java.lang.Object object)
Performs replacement of the value of the object's toString result at the start and end positions of the buffer containing the Expression.

Parameters:
position - the position at which to insert
object - the
See Also:
StringBuffer.insert(int,java.lang.String)

getTranslatedExpression

public java.lang.String getTranslatedExpression()
Returns the expression after translation.

Returns:
String

getOriginalExpression

public java.lang.String getOriginalExpression()
Returns the expression before translation.

Returns:
String

getContextType

public java.lang.String getContextType()
Returns the type which is the context of this expression.

Returns:
String the context type element.

getKind

public java.lang.String getKind()
Returns the Kind of this Expression (inv, post, or pre)

Returns:
String - returns the Kind of this translation

getName

public java.lang.String getName()
Returns:
String

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the name to set.

setContextType

public void setContextType(java.lang.String contextType)
Sets the context type (the type to which the expression applies --> the type declared after the 'context')

Parameters:
contextType - the name of the element which is the context type.

setKind

public void setKind(java.lang.String string)
Sets the "kind" of the OCL contraint (i.e, "pre", "post", "inv")

Parameters:
string -

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.