|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectPrimitiveOrStringOrNullDecl
public final class PrimitiveOrStringOrNullDecl extends Object implements StatementKind, Serializable
Represents a primitive value (including Strings). This type of statement doesn't actually transform any state, but it works out nicely to represent primitives as statements. This decl info is for primitives, strings and nulls (of any type).
| Modifier and Type | Field and Description |
|---|---|
static String |
ID
ID for parsing purposes (see StatementKinds.parse method) |
| Constructor and Description |
|---|
PrimitiveOrStringOrNullDecl(Class<?> t,
Object o)
Constructs a PrimitiveOrStringOrNullDeclInfo of type t and value o |
| Modifier and Type | Method and Description |
|---|---|
void |
appendCode(Variable newVar,
List<Variable> inputVars,
StringBuilder b)
Produces a Java source code representation of this statement and append it to the given StringBuilder. |
boolean |
equals(Object o)
Indicates whether this PrimitiveOrStringOrNullDeclInfo is equal to o |
ExecutionOutcome |
execute(Object[] statementInput,
PrintStream out)
Executes this statement, given the inputs to the statement. |
List<Class<?>> |
getInputTypes()
Extracts the input constraints for this PrimitiveOrStringOrNullDeclInfo |
Class<?> |
getOutputType()
Returns constraint to represent new reference to this statement |
Class<?> |
getType()
|
Object |
getValue()
Returns the value of this PrimitiveOrStringOrNullDeclInfo |
int |
hashCode()
Returns a hash code value for this PrimitiveOrStringOrNullDeclInfo |
static PrimitiveOrStringOrNullDecl |
nullOrZeroDecl(Class<?> c)
Returns the appropriate PrimitiveOrStringOrNullDeclInfo representative of the specified class c. |
static PrimitiveOrStringOrNullDecl |
parse(String s)
A string representing this primitive declaration. |
static Sequence |
sequenceForPrimitive(Object o)
Returns the sequence corresponding to the given non-null primitive value. |
String |
toParseableString()
Returns a string representation of this StatementKind, which can subsequently be used in this class's parse method. |
String |
toString()
Returns string representation of this PrimitiveOrStringOrNullDeclInfo |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ID
| Constructor Detail |
|---|
public PrimitiveOrStringOrNullDecl(Class<?> t,
Object o)
| Method Detail |
|---|
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
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 List<Class<?>> getInputTypes()
getInputTypes in interface StatementKind
public void appendCode(Variable newVar,
List<Variable> inputVars,
StringBuilder b)
StatementKind
appendCode in interface StatementKindpublic Object getValue()
public Class<?> getType()
public Class<?> getOutputType()
getOutputType in interface StatementKindpublic static PrimitiveOrStringOrNullDecl nullOrZeroDecl(Class<?> c)
public String toParseableString()
StatementKind
toParseableString in interface StatementKindpublic static Sequence sequenceForPrimitive(Object o)
public static PrimitiveOrStringOrNullDecl parse(String s)
throws StatementKindParseException
StatementKindParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||