class FirstJVarDeclaration extends BasicJAnnotatable implements JVarDeclaration, BlockContent, ClassContent, JClassItem
JClassItem.Kind| Modifier and Type | Field and Description |
|---|---|
private int |
mods |
private java.lang.String |
name |
private java.util.ArrayList<SuccessorJVarDeclaration> |
successors |
private JType |
type |
private JExpr |
value |
SMART_NAME_SORT| Constructor and Description |
|---|
FirstJVarDeclaration(int mods,
JType type,
java.lang.String name,
JExpr value) |
| Modifier and Type | Method and Description |
|---|---|
JVarDeclaration |
add(java.lang.String name)
Add another item to this declaration.
|
JVarDeclaration |
add(java.lang.String name,
JExpr init)
Add another item to this declaration.
|
JClassItem.Kind |
getItemKind()
Get the kind of item.
|
int |
getModifiers()
Get the modifiers of this item.
|
java.lang.String |
getName()
Get the name of this element, if there is one.
|
boolean |
hasAllModifiers(int mods)
Determine whether this item has all of the modifiers specified by the given bitwise-OR-joined argument.
|
boolean |
hasAnyModifier(int mods)
Determine whether this item has any of the modifiers specified by the given bitwise-OR-joined argument.
|
(package private) int |
mods() |
java.lang.String |
name()
Get the variable name.
|
JType |
type()
Get the variable type.
|
void |
write(SourceFileWriter writer) |
(package private) void |
write(SourceFileWriter writer,
FormatPreferences.Space beforeSemicolon) |
(package private) void |
writeNoSemi(SourceFileWriter writer) |
annotate, annotate, annotate, writeAnnotationsdeprecated, docComment, writeDocCommentsblockComment, lineComment, writeCommentsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitannotate, annotate, annotatedeprecated, docCommentblockComment, lineCommentprivate final int mods
private final JType type
private final java.lang.String name
private final JExpr value
private java.util.ArrayList<SuccessorJVarDeclaration> successors
public void write(SourceFileWriter writer) throws java.io.IOException
void write(SourceFileWriter writer, FormatPreferences.Space beforeSemicolon) throws java.io.IOException
java.io.IOExceptionvoid writeNoSemi(SourceFileWriter writer) throws java.io.IOException
java.io.IOExceptionpublic JType type()
JVarDeclarationtype in interface JVarDeclarationpublic java.lang.String name()
JVarDeclarationname in interface JVarDeclarationint mods()
public JVarDeclaration add(java.lang.String name, JExpr init)
JVarDeclarationadd in interface JVarDeclarationname - the variable nameinit - the variable initializerpublic JVarDeclaration add(java.lang.String name)
JVarDeclarationadd in interface JVarDeclarationname - the variable namepublic JClassItem.Kind getItemKind()
JClassItemgetItemKind in interface JClassItempublic int getModifiers()
JClassItemgetModifiers in interface JClassItemJModpublic boolean hasAllModifiers(int mods)
JClassItemhasAllModifiers in interface JClassItemmods - the modifier(s)true if all of the modifiers are present, false otherwisepublic boolean hasAnyModifier(int mods)
JClassItemhasAnyModifier in interface JClassItemmods - the modifier(s)true if any if the modifiers are present, false otherwisepublic java.lang.String getName()
JClassItemgetName in interface JClassItemnull if there is none