public class Variable extends java.lang.Object implements java.lang.Comparable<Variable>
Modifier | Constructor and Description |
---|---|
protected |
Variable()
Do not use! Only for use by DummyVariable.
|
|
Variable(Sequence owner,
int i) |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
classNameToVariableName(java.lang.String className)
Convert the classname to a variable name, preserving camel case if used.
|
(package private) static java.lang.String |
classToVariableName(Type type)
Build a variable name from the name of the given type.
|
int |
compareTo(Variable o) |
boolean |
equals(@Nullable java.lang.Object o) |
Statement |
getDeclaringStatement()
The statement that produced this variable.
|
int |
getDeclIndex()
The index of the statement that creates this value.
|
java.lang.String |
getName()
Returns the name of this variable.
|
private java.lang.String |
getName(java.lang.String className,
int i)
The name of this variable using the given type name and index.
|
Type |
getType()
Returns the type of this variable.
|
int |
hashCode() |
boolean |
shouldInlineLiterals()
True if this variable's value should be inlined as a literal at call sites, rather than
referencing the variable.
|
java.lang.String |
toString() |
public final int index
public final Sequence sequence
public Variable(Sequence owner, int i)
protected Variable()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Type getType()
public Statement getDeclaringStatement()
public int getDeclIndex()
public java.lang.String getName()
private java.lang.String getName(java.lang.String className, int i)
className
- the classname to usei
- the index to use in the namepublic int compareTo(Variable o)
compareTo
in interface java.lang.Comparable<Variable>
static java.lang.String classToVariableName(Type type)
type
- the typeprivate static java.lang.String classNameToVariableName(java.lang.String className)
className
- the class namepublic boolean shouldInlineLiterals()