public class AddAction extends DefaultAction implements IBufferAction, ISlotContainer
Constructor and Description |
---|
AddAction()
default constructor equivalent to AddAction("goal", null)
|
AddAction(java.lang.String bufferName,
java.lang.Object ref) |
AddAction(java.lang.String bufferName,
java.lang.Object ref,
java.util.Collection<? extends ISlot> slots)
add a chunk (ref) to bufferName buffer
|
Modifier and Type | Method and Description |
---|---|
void |
addSlot(ISlot s)
In addition to adding chunks to a buffer, the IChunk?s slot values can be
changed at the same time.
|
IAction |
bind(VariableBindings bindings)
Bind is called during the creation of an instantiation of a produciton.
|
protected void |
bindChunk(VariableBindings bindings) |
protected IRequest |
createRequest() |
void |
dispose()
Description of the Method
|
double |
fire(IInstantiation instantiation,
double firingTime)
Description of the Method
|
java.lang.String |
getBufferName()
return the name of the buffer that the chunk will be added to
|
IChunk |
getChunk()
return the chunk to be added if it was specified.
|
java.lang.String |
getChunkName()
return the variable name of the chunk if it has been specified, null
otherwise
|
IChunkType |
getChunkType()
return the chunktype of the to-be created chunk if it has been specified,
null otherwise
|
java.lang.Object |
getReferant()
Gets the referant attribute of the AddAction object
|
IRequest |
getRequest()
return a mutable copy of the request that underlies this action.
|
java.util.Collection<? extends ISlot> |
getSlots()
Return all the slots that this addaction will attempt to set for the to be
added chunk.
|
java.util.Collection<ISlot> |
getSlots(java.util.Collection<ISlot> slots) |
protected java.util.Collection<IMutableSlot> |
getSlotsInternal() |
void |
removeSlot(ISlot s)
Remove a specific slot from the addaction.
|
void |
setBufferName(java.lang.String name)
override the constructor and set the buffer name
|
void |
setChunk(IChunk c)
set the chunk that will be added to the buffer
|
void |
setChunkName(java.lang.String name)
set the variable name of the chunk to be added.
|
void |
setChunkType(IChunkType ct)
set the chunktype of the chunk to be created
|
void |
setReferant(java.lang.Object o)
Sets the referant attribute of the AddAction object
|
java.lang.String |
toString()
Description of the Method
|
bindSlotValues, resolve, updateSlots
public AddAction()
public AddAction(java.lang.String bufferName, java.lang.Object ref, java.util.Collection<? extends ISlot> slots)
bufferName
- name of the buffer to insert intoref
- IChunk, IChunkType, chunkName, or variable namepublic AddAction(java.lang.String bufferName, java.lang.Object ref)
public java.lang.String toString()
toString
in class java.lang.Object
public void dispose()
dispose
in interface IAction
dispose
in class DefaultAction
public java.lang.Object getReferant()
public void setReferant(java.lang.Object o)
o
- The new referant valuepublic IAction bind(VariableBindings bindings) throws CannotInstantiateException
IAction
bind
in interface IAction
CannotInstantiateException
protected void bindChunk(VariableBindings bindings) throws CannotInstantiateException
CannotInstantiateException
public java.lang.String getBufferName()
getBufferName
in interface IBufferAction
public void setBufferName(java.lang.String name)
setBufferName
in interface IBufferAction
name
- The new bufferName valuepublic void setChunkType(IChunkType ct)
ct
- The new chunkType valuepublic void setChunkName(java.lang.String name)
name
- The new chunkName valuepublic void setChunk(IChunk c)
c
- The new chunk valuepublic java.lang.String getChunkName()
public IChunkType getChunkType()
public IChunk getChunk()
protected java.util.Collection<IMutableSlot> getSlotsInternal()
public java.util.Collection<? extends ISlot> getSlots()
getSlots
in interface ISlotContainer
public java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
getSlots
in interface ISlotContainer
public void addSlot(ISlot s)
addSlot
in interface ISlotContainer
s
- The feature to be added to the ISlot attributepublic void removeSlot(ISlot s)
removeSlot
in interface ISlotContainer
s
- Description of Parameterpublic IRequest getRequest()
protected IRequest createRequest()
public double fire(IInstantiation instantiation, double firingTime)
DefaultAction
fire
in interface IAction
fire
in class DefaultAction
instantiation
- Description of the ParameterfiringTime
- when this production was fired