|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.javalanglevels.Data
public abstract class Data
Abstract class epresenting the data for a given braced body: a class, interface, method, or just a body.
| Nested Class Summary | |
|---|---|
static class |
Data.DataTest
Test the methods in the above class. |
| Field Summary | |
|---|---|
protected Iterator<BlockData> |
_blockIterator
Iterator over _blocks |
protected LinkedList<BlockData> |
_blocks
All blocks defined within this data, in lexical order. |
protected LinkedList<Data> |
_enclosingData
All enclosing data are in this list. |
protected LinkedList<SymbolData> |
_innerClasses
Any inner classes that are defined in this data. |
protected ModifiersAndVisibility |
_modifiersAndVisibility
The modifiers and visibility of this data. |
protected String |
_name
The fully qualified name of this data. |
protected Data |
_outerData
The outer data--what directly encloses this data. |
protected LinkedList<VariableData> |
_vars
The vars defined in the lexical scope of this data. |
| Constructor Summary | |
|---|---|
Data(Data outerData)
The default constructor for a Data. |
|
| Method Summary | |
|---|---|
void |
addBlock(BlockData b)
Add a BlockData to this Data's list of blocks. |
void |
addEnclosingData(Data enclosingData)
Add to the front because we want the outer data to be the last thing in the list. |
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 |
addInnerClass(SymbolData innerClass)
Add the specified SymbolData to the end of the list of inner classes. |
void |
addModifier(String modifier)
Add the specified modifier to the modifiers and visibility for this data, if it is not already present. |
boolean |
addVar(VariableData var)
Add the specified Variable Data to the list of variables defined in this scope, unless its name has already been used. |
boolean |
addVars(VariableData[] vars)
Add the array of variable datas to the list of variables defined in this scope, unless a name has already been used. |
String |
createUniqueName(String varName)
Check if varName is used in this Data's scope. |
static String |
dollarSignsToDots(String s)
Loop over the specified string, and replace any '$' with '.' This is used to change an inner class name to a standard format. |
static String |
dotsToDollarSigns(String s)
Loop over the specified string, and replace any '.' with '$' This is used to change an inner class name from external (as in Java source) to internal (as in class files) format. |
SymbolData |
getEnclosingClass()
|
LinkedList<Data> |
getEnclosingData()
|
LinkedList<SymbolData> |
getInnerClasses()
|
SymbolData |
getInnerClassOrInterface(String relName)
Takes in a relative name and tries to match it with one of this Data's inner classes or inner interfaces. |
protected SymbolData |
getInnerClassOrInterfaceHelper(String relName,
int firstIndexOfDot)
Takes in a relative name and tries to match it with one of this Data's inner classes or inner interfaces. |
ModifiersAndVisibility |
getMav()
|
String |
getName()
|
SymbolData |
getNextAnonymousInnerClass()
Determines the name of the next anonymous inner class (enclosing class name + '$' + sequence number). |
BlockData |
getNextBlock()
Returns the next block contained within this data. |
Data |
getOuterData()
|
abstract SymbolData |
getSymbolData()
Return the enclosing getSymbolData() |
VariableData |
getVar(String name)
Finds and returns the particular VariableData declared in this Data's context. |
LinkedList<VariableData> |
getVars()
|
boolean |
hasModifier(String modifier)
|
Iterator<SymbolData> |
innerClassesAndInterfacesIterator()
|
Boolean |
isAnonymousClass()
|
Boolean |
isDoublyAnonymous()
|
boolean |
isOuterData(Data d)
|
void |
removeAllBlocks()
Remove all blocks from this data's list of enclosed blocks. |
void |
resetBlockIterator()
Reset the block iterator to the beginning of the list of blocks. |
void |
setEnclosingData(LinkedList<Data> d)
|
void |
setInnerClasses(LinkedList<SymbolData> innerClasses)
Sets the inner classes of this Data. |
void |
setMav(ModifiersAndVisibility modifiersAndVisibility)
Assigns the specified modifiersAndVisiblity to this data. |
void |
setOuterData(Data outerData)
Sets the outer data to the specified value--throw an exception if the data already has an outer data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String _name
protected LinkedList<VariableData> _vars
protected LinkedList<Data> _enclosingData
protected ModifiersAndVisibility _modifiersAndVisibility
protected Data _outerData
protected LinkedList<SymbolData> _innerClasses
protected LinkedList<BlockData> _blocks
protected Iterator<BlockData> _blockIterator
| Constructor Detail |
|---|
public Data(Data outerData)
| Method Detail |
|---|
public String getName()
public Boolean isAnonymousClass()
public Boolean isDoublyAnonymous()
public VariableData getVar(String name)
name - Name of the variable
public LinkedList<VariableData> getVars()
public LinkedList<Data> getEnclosingData()
public void addEnclosingData(Data enclosingData)
public void setEnclosingData(LinkedList<Data> d)
public boolean addVar(VariableData var)
var - The variable we want to add to this scope.
public boolean addVars(VariableData[] vars)
vars - The VariableData[] that we want to add.
public boolean addFinalVars(VariableData[] vars)
vars - the VariableData[] that we want to add.
public ModifiersAndVisibility getMav()
public void setMav(ModifiersAndVisibility modifiersAndVisibility)
modifiersAndVisibility - The ModifiersAndVisibility to assign to this data.public abstract SymbolData getSymbolData()
public Data getOuterData()
public void setOuterData(Data outerData)
outerData - The Data that encloses this data.public boolean isOuterData(Data d)
public SymbolData getEnclosingClass()
public static String dollarSignsToDots(String s)
s - The String to change.
public static String dotsToDollarSigns(String s)
s - The String to change.
public SymbolData getNextAnonymousInnerClass()
public void resetBlockIterator()
public BlockData getNextBlock()
public void addBlock(BlockData b)
public void removeAllBlocks()
public SymbolData getInnerClassOrInterface(String relName)
relName - The name of the inner class or interface to find RELATIVE to this SymbolData
protected SymbolData getInnerClassOrInterfaceHelper(String relName,
int firstIndexOfDot)
public Iterator<SymbolData> innerClassesAndInterfacesIterator()
public LinkedList<SymbolData> getInnerClasses()
public void setInnerClasses(LinkedList<SymbolData> innerClasses)
public void addInnerClass(SymbolData innerClass)
innerClass - The SymbolData to add.public boolean hasModifier(String modifier)
public void addModifier(String modifier)
modifier - The String to add.public String createUniqueName(String varName)
varName - The initial String name of the variable we are creating.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||