|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectast.ASTNode
ast.Member
ast.Field
public class Field
The Field class represents a field (instance variable) declaration appearing in a class declaration. It contains a variable type (type ), a name (name), and an optional initialization expression ( init).
ASTNode
Field Summary | |
---|---|
protected Expr |
init
The (optional) initialization expression for the field (instance variable) |
protected java.lang.String |
name
The name of the field (instance variable) |
protected java.lang.String |
type
The type of the field (instance variable) |
Fields inherited from class ast.ASTNode |
---|
charNum, lineNum, lineStr |
Constructor Summary | |
---|---|
Field(int lineNum,
java.lang.String type,
java.lang.String name,
Expr init)
Field constructor |
Method Summary | |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method |
Expr |
getInit()
Get the initialization expression of the field |
java.lang.String |
getName()
Get the name of the field |
java.lang.String |
getType()
Get the type of the field |
Methods inherited from class ast.ASTNode |
---|
getLineNum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String type
protected java.lang.String name
protected Expr init
Constructor Detail |
---|
public Field(int lineNum, java.lang.String type, java.lang.String name, Expr init)
lineNum
- source line number corresponding to this AST nodetype
- the type of the field (instance variable)name
- the name of the field (instance variable)init
- the (optional) initialization expression for the field
(instance variable)Method Detail |
---|
public java.lang.String getType()
public java.lang.String getName()
public Expr getInit()
public java.lang.Object accept(visitor.Visitor v, java.lang.Object o)
accept
in class Member
v
- visitor objecto
- object to pass down
Visitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |