|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectArrayDeclaration
public final class ArrayDeclaration extends Object implements StatementKind, Serializable
Immutable. Represents a one-dimensional array creation statement, e.g. "int[] x = new int[2] { 3, 7 };"
| Modifier and Type | Field and Description |
|---|---|
static String |
ID
ID for parsing purposes (see StatementKinds.parse method) |
| Constructor and Description |
|---|
ArrayDeclaration(Class<?> elementType,
int length)
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendCode(Variable newVar,
List<Variable> inputVars,
StringBuilder b)
Appends string representation of ArrayDeclarationInfo into b. |
boolean |
equals(Object o)
|
ExecutionOutcome |
execute(Object[] statementInput,
PrintStream out)
Executes this statement, given the inputs to the statement. |
Class<?> |
getElementType()
Returns the class of type of elements held in this ArrayDeclarationInfo |
List<Class<?>> |
getInputTypes()
Extracts the input constraints for this ArrayDeclarationInfo |
Class<?> |
getOutputType()
Returns constraint to represent new reference to this statement, namely the receiver that is generated. |
int |
hashCode()
|
static StatementKind |
parse(String str)
A string representing this array declaration. |
String |
toParseableString()
Returns a string representation of this StatementKind, which can subsequently be used in this class's parse method. |
String |
toString()
|
String |
toStringShort()
|
String |
toStringVerbose()
|
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ID
| Constructor Detail |
|---|
public ArrayDeclaration(Class<?> elementType,
int length)
elementType - type of objects in the arraylength - number of objects allowed in the array| Method Detail |
|---|
public Class<?> getElementType()
public List<Class<?>> getInputTypes()
getInputTypes in interface StatementKind
public ExecutionOutcome execute(Object[] statementInput,
PrintStream out)
execute in interface StatementKindstatementInput - array containing appropriate inputs to statementout - stream to output results of execution;
can be null if you don't want to print.public String toString()
toString in class Objectpublic String toStringShort()
public String toStringVerbose()
public Class<?> getOutputType()
getOutputType in interface StatementKind
public void appendCode(Variable newVar,
List<Variable> inputVars,
StringBuilder b)
appendCode in interface StatementKindpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objectpublic String toParseableString()
StatementKind
toParseableString in interface StatementKindpublic static StatementKind parse(String str)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||