|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.javalanglevels.VariableData
public class VariableData
Represents the data for a given variable (including fields).
| Nested Class Summary | |
|---|---|
static class |
VariableData.VariableDataTest
Test the methods defined in the above class. |
| Constructor Summary | |
|---|---|
VariableData(java.lang.String name,
ModifiersAndVisibility modifiersAndVisibility,
SymbolData type,
boolean hasBeenAssigned,
Data enclosingData)
Constructor for VariableData. |
|
VariableData(SymbolData type)
This constructor is only used when reading method parameters in a class file because class files only store the types of method parameters. |
|
| Method Summary | |
|---|---|
void |
addModifier(java.lang.String s)
Add the specified modifier to the modifiers and visibility for this class, if it is not already there. |
VariableData |
copyWithoutVisibility()
Make a copy of this VariableData erasing all visibility modifiers and setting hasBeenAssigned to true. |
boolean |
equals(java.lang.Object obj)
Checks the values of the fields |
Data |
getEnclosingData()
|
InstanceData |
getInstanceData()
Assumes _type != null |
ModifiersAndVisibility |
getMav()
|
java.lang.String |
getName()
|
SymbolData |
getType()
|
boolean |
gotValue()
If this VariableData has not been given a value, set _hasBeenAssigned to true, and return true. |
int |
hashCode()
Hash on the name and enclosing data, since within each enclosing data, the variable name should be unique |
boolean |
hasInitializer()
Returns true iff this variable was declared with an initial value |
boolean |
hasModifier(java.lang.String modifier)
Returns true if this variable has the modifier specified. |
boolean |
hasValue()
Returns true if this VariableData has been given a value. |
boolean |
isFinal()
Returns true if this VariableData is final. |
boolean |
isGenerated()
|
boolean |
isLocalVariable()
|
boolean |
isPrivate()
Returns true if this VariableData is private. |
boolean |
isStatic()
Returns true if this VariableData is static. |
static boolean |
isVisibility(java.lang.String s)
|
boolean |
lostValue()
If this VariableData has a value, set _hasBeenAssigned to false, and return true. |
void |
setEnclosingData(Data d)
Sets the enclosing data to the specified value. |
void |
setFinal()
Adds "final" to the modifiers and visibility for this class, if it is not already there. |
void |
setFinalAndStatic()
Adds "final" and "static" to the modifiers and visibility for this class, if it is not already there. |
void |
setGenerated(boolean value)
Set the generated flag to the specified value |
void |
setHasInitializer(boolean value)
Set the "hasInitializer" flag |
void |
setHasValue()
Set _hasBeenAssigned flag. |
void |
setIsLocalVariable(boolean b)
Sets the isLocalVariable flag to the specified value. |
void |
setMav(ModifiersAndVisibility mav)
Set the modifiers and visibility to the specified value. |
void |
setName(java.lang.String s)
Set the name of this variable to the specified string. |
void |
setPrivate()
Adds "private" to the modifiers and visibility for this class, if it is not already there. |
void |
setPrivateAndFinal()
Adds "private" and "final" to the modifiers and visibility for this class, if it is not already there. |
void |
setType(SymbolData type)
Sets the SymbolData representing the type of this variable. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public VariableData(java.lang.String name,
ModifiersAndVisibility modifiersAndVisibility,
SymbolData type,
boolean hasBeenAssigned,
Data enclosingData)
false.
name - The name of the variablemodifiersAndVisibility - The modifiersAndVisibilitytype - The SymbolData type of the variable.hasBeenAssigned - true if this variable has a valueenclosingData - the enclosing datapublic VariableData(SymbolData type)
| Method Detail |
|---|
public VariableData copyWithoutVisibility()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getName()
public void setName(java.lang.String s)
public ModifiersAndVisibility getMav()
public void setMav(ModifiersAndVisibility mav)
public SymbolData getType()
public void setType(SymbolData type)
public InstanceData getInstanceData()
public Data getEnclosingData()
public void setEnclosingData(Data d)
public boolean isLocalVariable()
public void setIsLocalVariable(boolean b)
public void setFinal()
public void setPrivate()
public void addModifier(java.lang.String s)
public void setPrivateAndFinal()
public void setFinalAndStatic()
public boolean isFinal()
public boolean isPrivate()
public boolean isStatic()
public static boolean isVisibility(java.lang.String s)
public boolean hasModifier(java.lang.String modifier)
public void setGenerated(boolean value)
public boolean isGenerated()
public boolean hasInitializer()
public void setHasInitializer(boolean value)
public boolean hasValue()
public void setHasValue()
public boolean gotValue()
public boolean lostValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||