|
Spirograph Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspirograph.Recipie
Models the student code input, or "Recipie". A recipie consists of two
strings. The first string may contain any number of variable declarations and
defintions. The second string esentially contains a method body which is
interpreted to control the movement of a dot on the x or y axis (or both).
Classes which implement the RecipieListener
interface may register
be notified of changes in either the field text or the statement (method
body) text. An always empty static instance of this class is maintained as
the "null Recipie". Any recipie variable can point to this static instance
and be assured, both that it exists and that it will never have any code
or fields text.
Copyright © 2003 Franklin W. Olin College of Engineering.
RecipieView
,
Serialized FormField Summary | |
static Recipie |
nullRecipie
A recipie that represents a no data condition. |
Constructor Summary | |
Recipie()
Creates a new instance of RecipieModel |
Method Summary | |
void |
addRecipieListener(RecipieListener rl)
Register an object for notification of changes to this recipie. |
void |
fireRecipieChanged()
Manually ensure that all listners are updated. |
java.lang.String |
getCode()
Get the student code that represents a method body. |
java.lang.String |
getFields()
Get the student code that represents variable declarations and definitions. |
int |
getIdNum()
Get a unique identifier for this object. |
boolean |
isCompiled()
Ask this recipie if it has been compiled since it's last modification. |
void |
removeRecipieListener(RecipieListener rl)
Unregister an object that was listening to this recipie. |
void |
setCode(java.lang.String statements)
Store new student code. |
void |
setCompiled(boolean isComp)
Mark this code as having been compiled since it's last edit, or edited since it's last compile. |
void |
setFields(java.lang.String fields)
Store new student fields. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Recipie nullRecipie
UnsupportedOperationException
Constructor Detail |
public Recipie()
Method Detail |
public boolean isCompiled()
setCompiled(true)
callpublic int getIdNum()
public java.lang.String getCode()
getCode
in interface CodeSource
public java.lang.String getFields()
getFields
in interface CodeSource
public void setCompiled(boolean isComp)
isComp
- true
if the code has been compiled, false
if it has been modifiedpublic void setCode(java.lang.String statements) throws java.lang.UnsupportedOperationException
statements
- The student code to store.
java.lang.UnsupportedOperationException
- if invoked on nullRecipie
public void setFields(java.lang.String fields) throws java.lang.UnsupportedOperationException
fields
- The variable declarations and definitions to store.
java.lang.UnsupportedOperationException
- if invoked on nullRecipie
public void addRecipieListener(RecipieListener rl)
rl
- The object to registerpublic void removeRecipieListener(RecipieListener rl)
rl
- The object that wishes to be unregistered.public void fireRecipieChanged()
|
Spirograph Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |