org.jtool.jxplatform.wrapper
Class JxLocal

java.lang.Object
  extended byorg.jtool.jxplatform.wrapper.JxElement
      extended byorg.jtool.jxplatform.wrapper.JxDefUseExpression
          extended byorg.jtool.jxplatform.wrapper.JxLocal
Direct Known Subclasses:
JxParameter

public class JxLocal
extends JxDefUseExpression

An object wrapping the Local element.

Author:
Katsuhisa Maruyama

Field Summary
protected  JxVariable jvariable
          The variable declared in this local declaration.
 
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 JxLocal()
          Creates a new, empty object.
protected JxLocal(org.w3c.dom.Element elem)
          Creates a new object wrapping a Local element.
 
Method Summary
 boolean enclose(org.w3c.dom.Element elem)
          Tests if this local element encloses a given element.
 boolean equals(JxLocal jlocal)
          Tests if a given local wrapper equals to this one.
 org.w3c.dom.Element[] getAllElementsSharingTheSameType()
          Returns an array of all elements which shares the same type declaration.
 JxVariable getJxVariable()
          Returns the variable wrapper declared in this local declaration.
static org.w3c.dom.Element getLocalElement(org.w3c.dom.Element elem)
          Returns the Local element containing a given element.
 java.lang.String getName()
          Returns the name if this local.
 org.w3c.dom.Element getNameNode()
          Returns the name element of this local.
 int getNumOfVariablesInDeclaration()
          Returns the number of local varaibles declared in the same statement.
 java.lang.String getTypeFqn()
          Returns the fully qualified name of the type of this local.
 java.lang.String getTypeName()
          Returns the name of the type of this local.
 boolean hasInitialValue()
          Test if the value of the varibale in this local declaration is given.
 boolean isFinal()
          Test if the declared local variable is final.
static boolean isLocal(org.w3c.dom.Element elem)
          Tests if a given element equals to Local.
 boolean isOmitted()
          Test if the type of the declared local variable is ommited.
 boolean isVolatile()
          Test if the declared local variable is volatile.
 void print()
          Displays information about this local 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, 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

jvariable

protected JxVariable jvariable
The variable declared in this local declaration.

Constructor Detail

JxLocal

protected JxLocal()
Creates a new, empty object.


JxLocal

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

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

getName

public java.lang.String getName()
Returns the name if this local.

Returns:
The name string.

getNameNode

public org.w3c.dom.Element getNameNode()
Returns the name element of this local.

Returns:
The element indicating the local name.

getTypeName

public java.lang.String getTypeName()
Returns the name of the type of this local.

Overrides:
getTypeName in class JxElement
Returns:
The return type string.

getTypeFqn

public java.lang.String getTypeFqn()
Returns the fully qualified name of the type of this local.

Returns:
The fully-qualified name string.

getJxVariable

public JxVariable getJxVariable()
Returns the variable wrapper declared in this local declaration. The JavaVariable wrapper declared in this local declaration.


isLocal

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

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

getLocalElement

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

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

equals

public boolean equals(JxLocal jlocal)
Tests if a given local wrapper equals to this one.

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

enclose

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

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

isFinal

public boolean isFinal()
Test if the declared local variable is final.

Returns:
true if this local variable is final.

isVolatile

public boolean isVolatile()
Test if the declared local variable is volatile.

Returns:
true if this local is volatile.

isOmitted

public boolean isOmitted()
Test if the type of the declared local variable is ommited.

Returns:
true if the type is omitted.

hasInitialValue

public boolean hasInitialValue()
Test if the value of the varibale in this local declaration is given.

Returns:
true if this local declaration has initial value.

getNumOfVariablesInDeclaration

public int getNumOfVariablesInDeclaration()
Returns the number of local varaibles declared in the same statement.

Returns:
The number of the declared local variables.

getAllElementsSharingTheSameType

public org.w3c.dom.Element[] getAllElementsSharingTheSameType()
Returns an array of all elements which shares the same type declaration.

Returns:
The array of all elements which shares the same type declaration.

print

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

Overrides:
print in class JxDefUseExpression