org.oclparser.internal.core.model
Class OclElement

java.lang.Object
  extended byorg.oclparser.internal.core.model.OclElement
All Implemented Interfaces:
IOclElement
Direct Known Subclasses:
OclContext, OclFile, OclInvariant, OclPackage, OclPostCondition, OclPreCondition

public class OclElement
extends java.lang.Object
implements IOclElement

Is the base class for all OCL elements. Implements the Composite design pattern.


Constructor Summary
OclElement(java.lang.String name, int line, int column, IOclElement parent)
           
 
Method Summary
 void accept(IOclModelVisitor visitor)
          Accepts the given visitor.
 void addChild(IOclElement elem)
          Adds an OCL element as a child.
 IOclElement[] getChildren()
          Returns the children that are also OCL elements.
 int getColumn()
           
 int getEndColumn()
           
 int getEndLine()
           
 int getLength()
           
 int getLine()
           
 java.lang.String getName()
           
 IOclElement getParent()
           
 boolean hasChildren()
          Returns whether the OCL element has children.
 void setColumn(int column)
           
 void setEndColumn(int endColumn)
           
 void setEndLine(int endLine)
           
 void setLine(int line)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OclElement

public OclElement(java.lang.String name,
                  int line,
                  int column,
                  IOclElement parent)
Parameters:
name -
line -
column -
parent -
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface IOclElement
Returns:
Returns the name of the OCL element.

setLine

public void setLine(int line)
Specified by:
setLine in interface IOclElement
Parameters:
line - The start line to set.

getLine

public int getLine()
Specified by:
getLine in interface IOclElement
Returns:
Returns the start line of the OCL element.

setColumn

public void setColumn(int column)
Specified by:
setColumn in interface IOclElement
Parameters:
column - The start column to set.

getColumn

public int getColumn()
Specified by:
getColumn in interface IOclElement
Returns:
Returns the start column of the OCL element.

setEndLine

public void setEndLine(int endLine)
Specified by:
setEndLine in interface IOclElement
Parameters:
endLine - The end line to set.

getEndLine

public int getEndLine()
Specified by:
getEndLine in interface IOclElement
Returns:
Returns the end line.

setEndColumn

public void setEndColumn(int endColumn)
Specified by:
setEndColumn in interface IOclElement
Parameters:
endColumn - The end column to set.

getEndColumn

public int getEndColumn()
Specified by:
getEndColumn in interface IOclElement
Returns:
Returns the end column of the OCL element.

getLength

public int getLength()
Specified by:
getLength in interface IOclElement
Returns:
Returns the length of the OCL element.

getParent

public IOclElement getParent()
Specified by:
getParent in interface IOclElement
Returns:
Returns the parent OCL element of the current OCL element.

addChild

public void addChild(IOclElement elem)
Description copied from interface: IOclElement
Adds an OCL element as a child.

(Composite design pattern)

Specified by:
addChild in interface IOclElement

hasChildren

public boolean hasChildren()
Description copied from interface: IOclElement
Returns whether the OCL element has children.

(Composite design pattern)

Specified by:
hasChildren in interface IOclElement

getChildren

public IOclElement[] getChildren()
Description copied from interface: IOclElement
Returns the children that are also OCL elements.

(Composite design pattern)

Specified by:
getChildren in interface IOclElement

accept

public void accept(IOclModelVisitor visitor)
Description copied from interface: IOclElement
Accepts the given visitor. The visitor's visit method is called with this delta if applicable. If the visitor returns true, the children are also visited.

(Visitor design pattern)

Specified by:
accept in interface IOclElement

toString

public java.lang.String toString()