edu.rice.cs.javalanglevels
Class SymbolData

java.lang.Object
  extended by edu.rice.cs.javalanglevels.Data
      extended by edu.rice.cs.javalanglevels.TypeData
          extended by edu.rice.cs.javalanglevels.SymbolData
Direct Known Subclasses:
ArrayData, PrimitiveData

public class SymbolData
extends TypeData

Represents the data for a given class. There are two states of SymbolData. One is a continuation which is created when a type is referenced, but the corresponding class has not been read for its members. The other is a complete SymbolData containing all of the member data.


Nested Class Summary
static class SymbolData.SymbolDataTest
          Test the methods defined in the above class
 
Nested classes/interfaces inherited from class edu.rice.cs.javalanglevels.Data
Data.DataTest
 
Field Summary
static SymbolData AMBIGUOUS_REFERENCE
          Used when 2 or more SymbolDatas could match
static SymbolData BOOLEAN_TYPE
          This anonymous class represents the boolean primitive type
static SymbolData BYTE_TYPE
          This anonymous class represents the byte primitive type
static SymbolData CHAR_TYPE
          This anonymous class represents the char primitive type.
static SymbolData DOUBLE_TYPE
          This represents the double primitive
static SymbolData EXCEPTION
          Used for an exception
static SymbolData FLOAT_TYPE
          This represents the float primitive
static SymbolData INT_TYPE
          This anonymous class represents the int primitive type.
static SymbolData LONG_TYPE
          This represents the long primitive
static SymbolData NOT_FOUND
          Used to signal a symbol table search that failed.
static SymbolData NULL_TYPE
          Singleton class representing null
static SymbolData SHORT_TYPE
          This anonymous class represents the short primitive type.
static SymbolData SUPER_CONSTRUCTOR
          Used when a super constructor invocation is seen.
static SymbolData THIS_CONSTRUCTOR
          Used when a this constructor invocation is seen.
static SymbolData VOID_TYPE
          Used for the void type.
 
Fields inherited from class edu.rice.cs.javalanglevels.Data
_blockIterator, _blocks, _enclosingData, _innerClasses, _modifiersAndVisibility, _name, _outerData, _vars
 
Constructor Summary
SymbolData(String name)
          Creates a continuation symbol for the specified name; does not enter this name in any table.
SymbolData(String name, ModifiersAndVisibility modifiersAndVisibility, TypeParameter[] typeParameters, ArrayList<SymbolData> interfaces, Data outerData)
          This constructor is only called by Interfaces.
SymbolData(String name, ModifiersAndVisibility modifiersAndVisibility, TypeParameter[] typeParameters, SymbolData superClass, ArrayList<SymbolData> interfaces, Data outerData)
          Constructor for SymbolData
SymbolData(String name, ModifiersAndVisibility modifiersAndVisibility, TypeParameter[] typeParameters, SymbolData superClass, ArrayList<SymbolData> interfaces, Data outerData, String pkg)
          Constructor for SymbolData
SymbolData(String name, SourceInfo si)
          Creates a continuation symbol for the specified name and source info; does not enter this name in any table.
 
Method Summary
 boolean addFinalVars(VariableData[] vars)
          Add the array of variable datas to the list of variables defined in this scope, unless a name has already been used.
 void addInnerInterface(SymbolData innerInterface)
          Add the specified innerInterface to the list of innerInterfaces
 void addInterface(SymbolData interphace)
          Add an interface to the list of interfaces.
 void addMethod(MethodData method)
          When adding a method, we must check that the method's signature (name and parameters) does not match that of any other method in the same class.
 void addMethod(MethodData method, boolean isAugmentedCode)
          This version of addMethod is called whenever the method corresponds to one that is auto-generated (toString, equals, hashCode, etc.) and is necessary because we need to check if the user defined a method with the same signature and, if so, highlight the user method instead of trying to highlight the auto-generated method (which doesn't appear in the raw version of the source anyway).
 void addMethod(MethodData method, boolean isAugmentedCode, boolean fromClassFile)
          Important to know if this is called from a class file since JSR14 allows methods to have the same name and parameters with different return types for bridge methods.
 boolean addVar(VariableData var)
          Adds a (perhaps mutable) variable or field to a SymbolData.
 boolean addVars(VariableData[] vars)
          Adds fields or variables to a SymboLData.
protected static boolean checkDifferentReturnTypes(MethodData md, SymbolData sd, boolean addError, JavaVersion version)
          Called to make sure that no method has the same name and parameters as a method it inherits while having different return types.
protected static boolean checkDifferentReturnTypes(MethodData md, SymbolData sd, JavaVersion version)
          Call checkDifferentReturnTypes with addError set to true by default
 void clearSuperClass()
           
 String createUniqueMethodName(String methodName)
          Checks to see if methodName is used in this SymbolData's scope.
 void decrementConstructorCount()
          Subtract one from the number of constructors for this symbol data
 boolean equals(Object obj)
          Returns true if the provided Object is equal to this symbol data.
 LinkedList<VariableData> getAllSuperVars()
          Get all of your vars and all vars that you inherit.
 int getAnonymousInnerClassNum()
           
 int getConstructorCount()
           
protected  SymbolData getInnerClassOrInterfaceHelper(String nameToMatch, int firstIndexOfDot)
          Takes in a name and tries to match it with one of this Data's inner classes or inner interfaces.
 LinkedList<SymbolData> getInnerInterfaces()
           
 InstanceData getInstanceData()
           
 ArrayList<SymbolData> getInterfaces()
           
 MethodData getMethod(String name, TypeData[] paramTypes)
          Returns the method with the given name and param types.
 LinkedList<MethodData> getMethods()
           
 String getPackage()
           
 SymbolData getSuperClass()
           
 SymbolData getSymbolData()
          Return the enclosing getSymbolData()
 TypeParameter[] getTypeParameters()
           
 boolean hasAutoGeneratedJunitImport()
           
 int hashCode()
          Since SymbolDatas have unique names, in any given symboltable, hash on the name
 boolean hasInterface(SymbolData i)
          Check to see if the interface i appears anywhere in the hierarchy for this class/interface
 boolean hasMethod(String name)
          Returns true if there is a method with the given name in this SymbolData.
 boolean implementsRunnable()
          Check to see if this class is one of the 5 known classes that implement Runnable.
 void incrementConstructorCount()
          Add one to the number of constructors for this symbol data
 Iterator<SymbolData> innerClassesAndInterfacesIterator()
          Iterate over first the inner classes and then the inner interfaces.
 boolean isAssignableTo(SymbolData assignTo, JavaVersion version)
          See if this can be assigned to assignTo.
 boolean isCastableTo(SymbolData castTo, JavaVersion version)
          See if this can be cast as a castTo.
 boolean isContinuation()
           
 boolean isInnerClassOf(SymbolData outerClass, boolean stopAtStatic)
          Checks to see if this SymbolData is an inner class of outerClass (that is, that outerClass appears somewhere in its enclosing data chain.
 boolean isInstanceType()
           
 boolean isInterface()
           
 boolean isNonFloatOrBooleanType(JavaVersion version)
           
 boolean isNonFloatOrBooleanTypeWithoutAutoboxing()
           
 boolean isNumberType(JavaVersion version)
           
 boolean isNumberTypeWithoutAutoboxing()
           
 boolean isPrimitiveType()
          No reference type is a Primitive type.
 boolean isSubClassOf(SymbolData sd)
          Depth-first traversal of the tree of enclosing data checking to see if sd is above this SymbolData in the class hierarchy.
 int postdecrementAnonymousInnerClassNum()
          Return the anonymous inner class num, and then decrement it
 int postdecrementLocalClassNum()
          Return the local class num, and then decrement it
 int preincrementAnonymousInnerClassNum()
          Increment the anonymous inner class num, and return it
 int preincrementLocalClassNum()
          Increment the local class num and return it
static MethodData repeatedSignature(LinkedList<MethodData> listOfMethods, MethodData method)
          Calls repeatedSignature with fromClassFile set to false by default.
static MethodData repeatedSignature(LinkedList<MethodData> listOfMethods, MethodData method, boolean fromClassFile)
          Checks if two methods in this SymbolData have the same name and parameters.
 SymbolData resolve(SourceInfo si, LanguageLevelVisitor llv)
          Resolves this symbol using the visitor llv.
 void setAnonymousInnerClassNum(int i)
          Set the anonymous inner class num to the specified value
 void setHasAutoGeneratedJunitImport(boolean hasAutoGeneratedJunitImport)
          Set the isContinuation flag to the specified value
 void setInstanceData(InstanceData id)
          Sets the InstanceData for this class to the specified value.
 void setInterface(boolean ii)
           
 void setInterfaces(ArrayList<SymbolData> interfaces)
          Set the interfaces to be the specified list
 void setIsContinuation(boolean isContinuation)
          Set the isContinuation flag to the specified value
 void setMethods(LinkedList<MethodData> methods)
          Sets the list of methods to the specified one
 void setPackage(String pkg)
          Sets the package to the specified value
 void setSuperClass(SymbolData superClass)
          Set the super class to the specified value.
 void setTypeParameters(TypeParameter[] typeParameters)
          Set the generic type parameters to the specified value
 String toString()
           
 
Methods inherited from class edu.rice.cs.javalanglevels.Data
addBlock, addEnclosingData, addInnerClass, addModifier, createUniqueName, dollarSignsToDots, dotsToDollarSigns, getEnclosingClass, getEnclosingData, getInnerClasses, getInnerClassOrInterface, getMav, getName, getNextAnonymousInnerClass, getNextBlock, getOuterData, getVar, getVars, hasModifier, isAnonymousClass, isDoublyAnonymous, isOuterData, removeAllBlocks, resetBlockIterator, setEnclosingData, setInnerClasses, setMav, setOuterData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BOOLEAN_TYPE

public static final SymbolData BOOLEAN_TYPE
This anonymous class represents the boolean primitive type


CHAR_TYPE

public static final SymbolData CHAR_TYPE
This anonymous class represents the char primitive type.


BYTE_TYPE

public static final SymbolData BYTE_TYPE
This anonymous class represents the byte primitive type


SHORT_TYPE

public static final SymbolData SHORT_TYPE
This anonymous class represents the short primitive type.


INT_TYPE

public static final SymbolData INT_TYPE
This anonymous class represents the int primitive type.


LONG_TYPE

public static final SymbolData LONG_TYPE
This represents the long primitive


FLOAT_TYPE

public static final SymbolData FLOAT_TYPE
This represents the float primitive


DOUBLE_TYPE

public static final SymbolData DOUBLE_TYPE
This represents the double primitive


VOID_TYPE

public static final SymbolData VOID_TYPE
Used for the void type.


EXCEPTION

public static final SymbolData EXCEPTION
Used for an exception


NOT_FOUND

public static final SymbolData NOT_FOUND
Used to signal a symbol table search that failed.


NULL_TYPE

public static final SymbolData NULL_TYPE
Singleton class representing null


AMBIGUOUS_REFERENCE

public static final SymbolData AMBIGUOUS_REFERENCE
Used when 2 or more SymbolDatas could match


THIS_CONSTRUCTOR

public static final SymbolData THIS_CONSTRUCTOR
Used when a this constructor invocation is seen.


SUPER_CONSTRUCTOR

public static final SymbolData SUPER_CONSTRUCTOR
Used when a super constructor invocation is seen.

Constructor Detail

SymbolData

public SymbolData(String name,
                  ModifiersAndVisibility modifiersAndVisibility,
                  TypeParameter[] typeParameters,
                  SymbolData superClass,
                  ArrayList<SymbolData> interfaces,
                  Data outerData)
Constructor for SymbolData

Parameters:
name - The name of this class or interface
modifiersAndVisibility - The modifiersAndVisibility of this class or interface
typeParameters - Generic type info, not used
superClass - The super class of this class
interfaces - The super interfaces
outerData - The enclosing data of this class, or null

SymbolData

public SymbolData(String name,
                  ModifiersAndVisibility modifiersAndVisibility,
                  TypeParameter[] typeParameters,
                  SymbolData superClass,
                  ArrayList<SymbolData> interfaces,
                  Data outerData,
                  String pkg)
Constructor for SymbolData

Parameters:
name - The name of this class or interface
modifiersAndVisibility - The modifiersAndVisibility of this class or interface
typeParameters - Generic type info, not used
superClass - The super class of this class
interfaces - The super interfaces
outerData - The enclosing data of this class, or null

SymbolData

public SymbolData(String name,
                  ModifiersAndVisibility modifiersAndVisibility,
                  TypeParameter[] typeParameters,
                  ArrayList<SymbolData> interfaces,
                  Data outerData)
This constructor is only called by Interfaces. Thus, there is never a super class, and _isInterface is set to true.

Parameters:
name - The name of this class or interface
modifiersAndVisibility - The modifiersAndVisibility of this class or interface
typeParameters - Generic type info, not used
interfaces - The super interfaces
outerData - The enclosing data of this class, or null

SymbolData

public SymbolData(String name)
Creates a continuation symbol for the specified name; does not enter this name in any table.


SymbolData

public SymbolData(String name,
                  SourceInfo si)
Creates a continuation symbol for the specified name and source info; does not enter this name in any table.

Method Detail

isPrimitiveType

public boolean isPrimitiveType()
No reference type is a Primitive type.


toString

public String toString()
Overrides:
toString in class Object

isAssignableTo

public boolean isAssignableTo(SymbolData assignTo,
                              JavaVersion version)
See if this can be assigned to assignTo. An assignment is legal: 1. if this is a class type - if assignTo is a class type, then the types must be the same, or this must be a subclass of assignTo - if assignTo is an interface, then we must implement it. - if assignTo is an array, then it is not assignable. 2. if this is an interface - if assignTo is a class, assignTo must be java.lang.Object. - if assignTo is an interface, then the types must be the same, or this must be a subinterface of assignTo. - if assignTo is an array, then it is not assignable All of these rules are followed in isSubclassOf(), which traverses the hierarchy.


resolve

public SymbolData resolve(SourceInfo si,
                          LanguageLevelVisitor llv)
Resolves this symbol using the visitor llv.

Returns:
the new symbol definition.

isCastableTo

public boolean isCastableTo(SymbolData castTo,
                            JavaVersion version)
See if this can be cast as a castTo. A cast is legal if: 1. if both sides are the same type 2. Both are primitives and - a widening primitive coversion is possible OR - a narrowing primitive conversion is possible 3. this is a class type and - castTo is a class type and one is the super class of the other - castTo is an interface type and this is not final OR this implements castTo - castTo is an array type, and this is Object 4. this is an interface type and - castTo is a class type and is not final OR this implements this - castTo is an interface type and this and castTo do not contain one or more methods with the same signature but different return types - castTo is an array type and this is either Serializable or Cloneable.

Parameters:
castTo - The TypeData we are trying to cast to. (castTo) this
Returns:
true If the cast is legal, false otherwise.

isSubClassOf

public boolean isSubClassOf(SymbolData sd)
Depth-first traversal of the tree of enclosing data checking to see if sd is above this SymbolData in the class hierarchy.


isInnerClassOf

public boolean isInnerClassOf(SymbolData outerClass,
                              boolean stopAtStatic)
Checks to see if this SymbolData is an inner class of outerClass (that is, that outerClass appears somewhere in its enclosing data chain. If stopAtStatic flag is true, stop as soon as we see a static class in the chain. This is because we are trying to resolve something, such as a "this" call, that cannot be seen outside of a static inner class.

Parameters:
outerClass - The SymbolData we believe might be our outer class.
stopAtStatic - boolean flag, true if we want to stop at a static outer class.
Returns:
true if we are its inner class, false otherwise.

isInstanceType

public boolean isInstanceType()
Specified by:
isInstanceType in class TypeData
Returns:
false, since this is a SymbolData and not an InstanceData

getSymbolData

public SymbolData getSymbolData()
Description copied from class: Data
Return the enclosing getSymbolData()

Specified by:
getSymbolData in class TypeData
Returns:
this SymbolData.

getInstanceData

public InstanceData getInstanceData()
Specified by:
getInstanceData in class TypeData
Returns:
the InstanceData corresponding to this class.

setInstanceData

public void setInstanceData(InstanceData id)
Sets the InstanceData for this class to the specified value.


getPackage

public String getPackage()
Returns:
the package

setPackage

public void setPackage(String pkg)
Sets the package to the specified value


getTypeParameters

public TypeParameter[] getTypeParameters()
Returns:
the generic type parameters

setTypeParameters

public void setTypeParameters(TypeParameter[] typeParameters)
Set the generic type parameters to the specified value


isInterface

public boolean isInterface()
Returns:
true if this is an interface

setInterface

public void setInterface(boolean ii)

getInnerInterfaces

public LinkedList<SymbolData> getInnerInterfaces()
Returns:
the list of inner interfaces

getInnerClassOrInterfaceHelper

protected SymbolData getInnerClassOrInterfaceHelper(String nameToMatch,
                                                    int firstIndexOfDot)
Takes in a name and tries to match it with one of this Data's inner classes or inner interfaces. The input string is a name relative to this SymbolData (such as B.C to request the class A.B.C from class A) and may be delimited by '.' or '$'. TODO; NO!!! This is broken. '$' appears in anonymous class names and local class names, where it is NOT used as a name segment separator Checks the super class and interfaces of this SymbolData to see if the inner class or interface can be found there. If no matching visibile inner classes or interfaces are found, but one or more that are not visible are found, one of the non-visibile ones will be returned.

Overrides:
getInnerClassOrInterfaceHelper in class Data
Returns:
The SymbolData for the matching inner class or interface or null if there isn't one or SymbolData. AMBIGUOUS_REFERENCE if the reference is ambiguous.

innerClassesAndInterfacesIterator

public Iterator<SymbolData> innerClassesAndInterfacesIterator()
Iterate over first the inner classes and then the inner interfaces.

Overrides:
innerClassesAndInterfacesIterator in class Data

addInnerInterface

public void addInnerInterface(SymbolData innerInterface)
Add the specified innerInterface to the list of innerInterfaces


preincrementLocalClassNum

public int preincrementLocalClassNum()
Increment the local class num and return it


setAnonymousInnerClassNum

public void setAnonymousInnerClassNum(int i)
Set the anonymous inner class num to the specified value


preincrementAnonymousInnerClassNum

public int preincrementAnonymousInnerClassNum()
Increment the anonymous inner class num, and return it


getAnonymousInnerClassNum

public int getAnonymousInnerClassNum()
Returns:
the anonymous inner class num

postdecrementLocalClassNum

public int postdecrementLocalClassNum()
Return the local class num, and then decrement it


postdecrementAnonymousInnerClassNum

public int postdecrementAnonymousInnerClassNum()
Return the anonymous inner class num, and then decrement it


addVar

public boolean addVar(VariableData var)
Adds a (perhaps mutable) variable or field to a SymbolData.

Overrides:
addVar in class Data
Parameters:
var - The variable we want to add to this scope.
Returns:
true if it was successfully added, false otherwise.

addVars

public boolean addVars(VariableData[] vars)
Adds fields or variables to a SymboLData.

Overrides:
addVars in class Data
Parameters:
vars - The VariableData[] that we want to add.
Returns:
true if all VariableDatas were added successfully, false otherwise.

addFinalVars

public boolean addFinalVars(VariableData[] vars)
Add the array of variable datas to the list of variables defined in this scope, unless a name has already been used. Return true if all variables were added successfully, false otherwise. Set each of the variable datas in the array to be final before adding them. Since this method is used to add fields at the Functional level, and at this level, we do not want the user to be able to shadow fields defined in the superclass hierarchy, instead of using the normal repeated Name method, check the repeated name throughout the hierarchy.

Overrides:
addFinalVars in class Data
Parameters:
vars - The VariableData[] that we want to add.
Returns:
true if all VariableDatas were added successfully, false otherwise.

getMethods

public LinkedList<MethodData> getMethods()
Returns:
the list of methods defined in this symbol data

hasMethod

public boolean hasMethod(String name)
Returns true if there is a method with the given name in this SymbolData.

Parameters:
name - The name of the method to return
Returns:
true if a MethodData is found or false otherwise.

getMethod

public MethodData getMethod(String name,
                            TypeData[] paramTypes)
Returns the method with the given name and param types.

Parameters:
name - The name of the method to return
paramTypes - Array of the TypeDatas correpsonding to the parameters to the method.
Returns:
The matched MethodData or null if it is not found

setMethods

public void setMethods(LinkedList<MethodData> methods)
Sets the list of methods to the specified one


repeatedSignature

public static MethodData repeatedSignature(LinkedList<MethodData> listOfMethods,
                                           MethodData method)
Calls repeatedSignature with fromClassFile set to false by default.


repeatedSignature

public static MethodData repeatedSignature(LinkedList<MethodData> listOfMethods,
                                           MethodData method,
                                           boolean fromClassFile)
Checks if two methods in this SymbolData have the same name and parameters.

Parameters:
listOfMethods - The methods in this SymbolData
method - The MethodData for the method to be added
fromClassFile - Whether or not a class file is adding this method. Important because bridge methods, which differ only in return type, can be added from a class file and are legal but cannot exist in source code.
Returns:
the MethodData that was already in listOfMethods that method duplicates if there is one or null otherwise.

checkDifferentReturnTypes

protected static boolean checkDifferentReturnTypes(MethodData md,
                                                   SymbolData sd,
                                                   JavaVersion version)
Call checkDifferentReturnTypes with addError set to true by default


checkDifferentReturnTypes

protected static boolean checkDifferentReturnTypes(MethodData md,
                                                   SymbolData sd,
                                                   boolean addError,
                                                   JavaVersion version)
Called to make sure that no method has the same name and parameters as a method it inherits while having different return types.

Parameters:
md - The MethodData we're currently trying to add
sd - The SymbolData of the class whose enclosingDatas we're examining for different return types.
addError - true if errors should be added to the type checker
Returns:
Whether there exists a conflict

createUniqueMethodName

public String createUniqueMethodName(String methodName)
Checks to see if methodName is used in this SymbolData's scope. If so, finds a new name for the method by appending a counter to its name until an unused method name results. Returns the new name.

Parameters:
methodName - The initial String name of the variable we are creating.
Returns:
The new variable name which does not shadow anything in vars.

addMethod

public void addMethod(MethodData method)
When adding a method, we must check that the method's signature (name and parameters) does not match that of any other method in the same class. We also must check that a method does not have the same signature but a different return type from a method in its superclass or one of its interfaces. `


addMethod

public void addMethod(MethodData method,
                      boolean isAugmentedCode)
This version of addMethod is called whenever the method corresponds to one that is auto-generated (toString, equals, hashCode, etc.) and is necessary because we need to check if the user defined a method with the same signature and, if so, highlight the user method instead of trying to highlight the auto-generated method (which doesn't appear in the raw version of the source anyway).


addMethod

public void addMethod(MethodData method,
                      boolean isAugmentedCode,
                      boolean fromClassFile)
Important to know if this is called from a class file since JSR14 allows methods to have the same name and parameters with different return types for bridge methods.


getSuperClass

public SymbolData getSuperClass()
Returns:
the superClass of this symbol data

clearSuperClass

public void clearSuperClass()

setSuperClass

public void setSuperClass(SymbolData superClass)
Set the super class to the specified value.


getInterfaces

public ArrayList<SymbolData> getInterfaces()
Returns:
the interfaces of this symbol data

addInterface

public void addInterface(SymbolData interphace)
Add an interface to the list of interfaces. TODO: find out where null is being added as an interface!


setInterfaces

public void setInterfaces(ArrayList<SymbolData> interfaces)
Set the interfaces to be the specified list


incrementConstructorCount

public void incrementConstructorCount()
Add one to the number of constructors for this symbol data


decrementConstructorCount

public void decrementConstructorCount()
Subtract one from the number of constructors for this symbol data


getConstructorCount

public int getConstructorCount()
Returns:
the number of constructors

isContinuation

public boolean isContinuation()
Returns:
true if this is a continuation

setIsContinuation

public void setIsContinuation(boolean isContinuation)
Set the isContinuation flag to the specified value


hasAutoGeneratedJunitImport

public boolean hasAutoGeneratedJunitImport()
Returns:
true if this is a continuation

setHasAutoGeneratedJunitImport

public void setHasAutoGeneratedJunitImport(boolean hasAutoGeneratedJunitImport)
Set the isContinuation flag to the specified value


isNumberTypeWithoutAutoboxing

public boolean isNumberTypeWithoutAutoboxing()
Returns:
true if this Symbol Data is a primitive type that is a number type

isNumberType

public boolean isNumberType(JavaVersion version)
Returns:
true if this Symbol Data is a primitive type that is a number type or is a Object number type with autoboxing enabled.

isNonFloatOrBooleanType

public boolean isNonFloatOrBooleanType(JavaVersion version)
Returns:
true if this is a non float or boolean type, with autoboxing if it is allowed, or without autoboxing

isNonFloatOrBooleanTypeWithoutAutoboxing

public boolean isNonFloatOrBooleanTypeWithoutAutoboxing()
Returns:
true if this is a non float or boolean type, without autoboxing

equals

public boolean equals(Object obj)
Returns true if the provided Object is equal to this symbol data. SymbolDatas are equal if their fields are the same.

Overrides:
equals in class Object

hashCode

public int hashCode()
Since SymbolDatas have unique names, in any given symboltable, hash on the name

Overrides:
hashCode in class Object

implementsRunnable

public boolean implementsRunnable()
Check to see if this class is one of the 5 known classes that implement Runnable. Checking each class recursively to see if it extends Runnable is too time consuming, so we are hoping this short cut will work. Clearly, this has some disadvantages.


hasInterface

public boolean hasInterface(SymbolData i)
Check to see if the interface i appears anywhere in the hierarchy for this class/interface


getAllSuperVars

public LinkedList<VariableData> getAllSuperVars()
Get all of your vars and all vars that you inherit.