edu.wpi.ebob.model
Class Parameter

java.lang.Object
  extended by edu.wpi.ebob.model.Parameter

public class Parameter
extends java.lang.Object

Represents an input parameter for a method or constructor, or the input value for a field.

Author:
Liam Morley

Field Summary
private  java.lang.String input
           
private  IObject result
           
private  IClass returnType
           
private  Scanner scanner
           
private  java.util.Collection tokens
           
 
Constructor Summary
Parameter(IClass returnType)
          Constructs a new Parameter with the given return type.
 
Method Summary
 IObject evaluate()
          evaluates the user input to an IObject.
 java.lang.String getInput()
           
 IClass getReturnType()
           
 void setInput(java.lang.String input)
          sets the value of this parameter to the user-input string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

returnType

private IClass returnType

input

private java.lang.String input

scanner

private Scanner scanner

tokens

private java.util.Collection tokens

result

private IObject result
Constructor Detail

Parameter

public Parameter(IClass returnType)
Constructs a new Parameter with the given return type.

Method Detail

setInput

public void setInput(java.lang.String input)
sets the value of this parameter to the user-input string.


getReturnType

public IClass getReturnType()
Returns:
Returns the returnType.

getInput

public java.lang.String getInput()

evaluate

public IObject evaluate()
                 throws ParserException
evaluates the user input to an IObject.

Returns:
an IObject if the input string is valid.
Throws:
java.lang.IllegalStateException - if the input has not yet been set.
ParserException - if the input string is invalid
java.lang.ClassCastException - if the input string does not resolve to an instance of returnType or any of its superclasses