|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.framescript.Term
unsw.cse.framescript.Frame
unsw.cse.framescript.Instance
public class Instance
This class implements instance frames in FrameScript.
Constructor Summary | |
---|---|
Instance()
Creates an unnamed instance frame. |
|
Instance(Atom name)
Creates a named instance frame. |
Method Summary | |
---|---|
void |
addParent(Generic parent)
Adds a parent to the frame. |
java.lang.String |
asText()
Writes the frame as FrameScript. |
Term |
getSlot(Atom slot)
Gets the value of a slot for the instance. |
void |
initFrame()
Initialises the frame. |
Term |
putSlot(Atom slot,
Term value)
Puts a value into a slot in an instance frame. |
Term |
removeSlot(Atom slot)
Removes a slot from the instance frame. |
Term |
removeSlot(Atom slot,
Term value)
Removes a specific value from a slot in an instance frame. |
Term |
replaceSlot(Atom slot,
Term value)
Replaces the value of a slot. |
java.lang.String |
toString()
Turns the Term into a string. |
Methods inherited from class unsw.cse.framescript.Frame |
---|
equals, eval |
Methods inherited from class unsw.cse.framescript.Term |
---|
assign, asString, fullMatch, indents, mapVars, match |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Instance()
public Instance(Atom name)
name
- the name of the frameMethod Detail |
---|
public void addParent(Generic parent) throws FSException
parent
- the parent being added, this should either be a frame or the name of
a frame
FSException
- if adding t as a parent would create an inheritance cyclepublic void initFrame() throws FSException
Frame
initFrame
in class Frame
FSException
public Term getSlot(Atom slot) throws FSException
slot
- the name of the slot
FSException
- if there is an error evaluating the slot's valuepublic Term putSlot(Atom slot, Term value) throws FSException
slot
- the name of the slotvalue
- the value to be put into the slot
FSException
- any errors putting into the slotpublic Term replaceSlot(Atom slot, Term value) throws FSException
slot
- the name of the slotvalue
- the new value for the slot
FSException
- any errors replacing the slot valuepublic Term removeSlot(Atom slot) throws FSException
slot
- the name of the slot
FSException
- any errors removing the slotpublic Term removeSlot(Atom slot, Term value) throws FSException
slot
- the name of the slotvalue
- the value to be removed from the slot
FSException
public java.lang.String toString()
Term
toString
in class Frame
public java.lang.String asText()
Frame
asText
in class Frame
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |