org.jtool.jxplatform.wrapper
Class JxStatement

java.lang.Object
  extended byorg.jtool.jxplatform.wrapper.JxElement
      extended byorg.jtool.jxplatform.wrapper.JxDefUseExpression
          extended byorg.jtool.jxplatform.wrapper.JxStatement

public class JxStatement
extends JxDefUseExpression

An object wrapping the Stmt element.

Author:
Katsuhisa Maruyama

Field Summary
protected  java.lang.String sort
          The sort of this statement;
 
Fields inherited from class org.jtool.jxplatform.wrapper.JxDefUseExpression
defs, expressions, uses
 
Fields inherited from class org.jtool.jxplatform.wrapper.JxElement
element
 
Constructor Summary
protected JxStatement()
          Creates a new, empty object.
protected JxStatement(org.w3c.dom.Element elem)
          Creates a new object wrapping a Stmt element.
 
Method Summary
 boolean enclose(org.w3c.dom.Element elem)
          Tests if this statement element encloses a given element.
 boolean equals(JxStatement jst)
          Tests if a given statement wrapper equals to this one.
 java.lang.String getSort()
          Returns the sort of this statement.
static org.w3c.dom.Element getStatementElement(org.w3c.dom.Element elem)
          Returns the Stmt element containing a given element.
 boolean isBlockStatement()
          Tests if this element is the block statement.
 boolean isBreakStatement()
          Tests if this element is the break statement.
 boolean isContinueStatement()
          Tests if this element is the continue statement.
 boolean isDoStatement()
          Tests if this element is the do statement.
 boolean isEmptyStatement()
          Tests if this element is the empty statement.
 boolean isExpressionStstement()
          Tests if this element is the expression statement.
 boolean isForStatement()
          Tests if this element is the for statement.
 boolean isIfStatement()
          Tests if this element is the if statement.
 boolean isReturnStatement()
          Tests if this element is the return statement.
static boolean isStatement(org.w3c.dom.Element elem)
          Tests if a given element equals to Stmt.
 boolean isSwitchStatement()
          Tests if this element is the switch statement.
 boolean isSynchronizedStatement()
          Tests if this element is the synchronized statement.
 boolean isThrowStatement()
          Tests if this element is the throw statement.
 boolean isTryStatement()
          Tests if this element is the try statement.
 boolean isWhileStatement()
          Tests if this element is the while statement.
 void print()
          Displays information about this statement wrapper for debugging.
 
Methods inherited from class org.jtool.jxplatform.wrapper.JxDefUseExpression
addDefinedVariable, addDefinedVariableFirst, addUsedVariable, addUsedVariableFirst, clearDefinedVariable, clearUsedVariable, definesVariable, equals, getDefinedVariables, getExpressions, getUsedVariables, removeDefinedVariable, removeUsedVariable, usesVariable
 
Methods inherited from class org.jtool.jxplatform.wrapper.JxElement
equals, existInTheSameClass, existInTheSameField, existInTheSameFile, existInTheSameMethod, existsInTheSameClass, existsInTheSameFile, existsInTheSameMethod, existsInTheSamePackage, getArrayOfElements, getChildElement, getChildElement, getChildElements, getChildElements, getChildNodes, getChildNodes, getClassElement, getDescendantElements, getDescendantElements, getDescendantElements, getDescendantElements, getElement, getElementById, getExpressionElements, getFieldElement, getFileElement, getFirstChildElement, getFirstChildElement, getId, getId, getIdentName, getIdentName, getJxClass, getJxField, getJxFile, getJxMethod, getJxStaticInit, getKeyword, getLine, getMethodElement, getStatementElement, getStaticInitElement, getTypeElement, getTypeElements, getTypeName, indexOf, indexOf, isBinary, isClass, isClassOrInterface, isConstructor, isExpression, isField, isFile, isImport, isInterface, isInTheSameField, isLocal, isMethod, isMethodOrConstructor, isPackage, isParameter, isStatement, isStaticInit, isTerminalElement, isType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sort

protected java.lang.String sort
The sort of this statement;

Constructor Detail

JxStatement

protected JxStatement()
Creates a new, empty object.


JxStatement

protected JxStatement(org.w3c.dom.Element elem)
               throws JxWrapperException
Creates a new object wrapping a Stmt element.

Parameters:
elem - An DOM element to be wrapped.
Throws:
JxWrapperException - if the specified element is not valid.
Method Detail

getSort

public java.lang.String getSort()
Returns the sort of this statement.

Returns:
The sort string.

isStatement

public static boolean isStatement(org.w3c.dom.Element elem)
Tests if a given element equals to Stmt.

Parameters:
elem - An element of the DOM.
Returns:
true if the element equals to Stmt.

getStatementElement

public static org.w3c.dom.Element getStatementElement(org.w3c.dom.Element elem)
Returns the Stmt element containing a given element.

Parameters:
elem - An element of the DOM.
Returns:
The Stmt element, or null if there is no such element.

equals

public boolean equals(JxStatement jst)
Tests if a given statement wrapper equals to this one.

Parameters:
jst - A statement wrapper.
Returns:
true if the statement wrapper equals to this one, otherwise false.

enclose

public boolean enclose(org.w3c.dom.Element elem)
Tests if this statement element encloses a given element.

Parameters:
elem - An element of the DOM.
Returns:
true if this element encloses the element.

isEmptyStatement

public boolean isEmptyStatement()
Tests if this element is the empty statement.

Returns:
true if this element is the empty statement.

isExpressionStstement

public boolean isExpressionStstement()
Tests if this element is the expression statement.

Returns:
if this element is the expression statement.

isBlockStatement

public boolean isBlockStatement()
Tests if this element is the block statement.

Returns:
true if this element is the block statement.

isDoStatement

public boolean isDoStatement()
Tests if this element is the do statement.

Returns:
if this element is the do statement.

isWhileStatement

public boolean isWhileStatement()
Tests if this element is the while statement.

Returns:
true if this element is the while statement.

isForStatement

public boolean isForStatement()
Tests if this element is the for statement.

Returns:
true if this element is the for statement.

isIfStatement

public boolean isIfStatement()
Tests if this element is the if statement.

Returns:
true if this element is the if statement.

isSwitchStatement

public boolean isSwitchStatement()
Tests if this element is the switch statement.

Returns:
true if this element is the switch statement.

isBreakStatement

public boolean isBreakStatement()
Tests if this element is the break statement.

Returns:
true if this element is the break statement.

isContinueStatement

public boolean isContinueStatement()
Tests if this element is the continue statement.

Returns:
if this element is the continue statement.

isReturnStatement

public boolean isReturnStatement()
Tests if this element is the return statement.

Returns:
true if this element is the return statement.

isSynchronizedStatement

public boolean isSynchronizedStatement()
Tests if this element is the synchronized statement.

Returns:
true if this element is the synchronized statement.

isThrowStatement

public boolean isThrowStatement()
Tests if this element is the throw statement.

Returns:
true if this element is the throw statement.

isTryStatement

public boolean isTryStatement()
Tests if this element is the try statement.

Returns:
true if this element is the try statement.

print

public void print()
Displays information about this statement wrapper for debugging.

Overrides:
print in class JxDefUseExpression