public abstract class AbstractActivationBuffer6 extends AbstractActivationBuffer implements IStatusBuffer
ACTIVATION_PARAM, GOAL_VALUE_PARAM, STRICT_HARVESTING_PARAM
BUFFER_SLOT, ERROR_CHANGED_TOO_MUCH_CHUNK, ERROR_DELETED_CHUNK, ERROR_INVALID_INDEX_CHUNK, ERROR_NO_LONGER_AVAILABLE_CHUNK, ERROR_NOTHING_AVAILABLE_CHUNK, ERROR_NOTHING_MATCHES_CHUNK, ERROR_SLOT, ERROR_UNKNOWN_CHUNK, STATE_SLOT
AURAL, AURAL_LOCATION, GOAL, IMAGINAL, MOTOR, RETRIEVAL, VISUAL, VISUAL_LOCATION, VOCAL
Constructor and Description |
---|
AbstractActivationBuffer6(java.lang.String name,
IModule module) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ISlotContainerListener listener,
java.util.concurrent.Executor executor) |
void |
addSlot(ISlot slot)
Adds a slot
|
IChunk |
addSourceChunk(IChunk sourceChunk)
ensure that all chunks added are copies
|
int |
bind(SlotBasedRequest request,
VariableBindings bindings,
boolean isIterative)
Required to permit status buffers to participate in the variable binding
process of production instantiation.
|
protected boolean |
checkStatusSlotContent(java.lang.String slotName,
java.lang.Object value) |
protected java.util.Collection<IChunk> |
clearInternal()
clear the status slots too
|
void |
dispose()
clean up resources, called by the module that created the buffer
|
IChunk |
getBusyChunk() |
IChunk |
getEmptyChunk() |
IChunk |
getErrorChunk() |
IChunk |
getFreeChunk() |
IChunk |
getFullChunk() |
IChunk |
getRequestedChunk() |
ISlot |
getSlot(java.lang.String name)
return the actual named slot.
|
java.util.Collection<? extends ISlot> |
getSlots()
return a duplicate copy of all the slots
|
java.util.Collection<ISlot> |
getSlots(java.util.Collection<ISlot> slots) |
IChunk |
getUnrequestedChunk() |
protected void |
grabReferences()
called once the model is started.
|
boolean |
hasSlot(java.lang.String name) |
boolean |
isBufferEmpty()
this actually checks the contents of the buffer slot which might not be the
best test in the case of buffers that share a common set of state slots
(i.e.
|
boolean |
isBufferFull() |
boolean |
isBufferRequested() |
boolean |
isBufferUnrequested() |
boolean |
isErrorSet() |
boolean |
isStateBusy() |
boolean |
isStateError() |
boolean |
isStateFree() |
void |
removeListener(ISlotContainerListener listener) |
void |
removeSlot(ISlot slot)
remove a slot
|
void |
setBufferChunk(IChunk bufferState) |
void |
setErrorChunk(IChunk chunk) |
void |
setStateChunk(IChunk chunk) |
protected void |
setStatusSlotContent(java.lang.String slotName,
java.lang.Object value) |
protected boolean |
shouldAcceptAsSource(IChunk futureSourceChunk) |
protected boolean |
shouldCopyOnInsertion(IChunk chunk)
return true if this chunk should be copied, currently it just returns
IChunk.isEncoded() or
BufferUtilities.getContainingBuffers(IChunk, boolean) .size()!=0. |
protected void |
sourceChunkCopied(IChunk originalChunk,
IChunk nextSourceChunk)
called when we have to copy the source chunk before adding it.
|
void |
valueChanged(ISlot slot,
java.lang.Object oldValue,
java.lang.Object newValue)
method used by the owned slot to communicate its change of value to the
container
|
addListener, addSourceChunkInternal, clear, contains, containsExact, getActivation, getActivationSpreader, getEventDispatcher, getG, getLock, getModel, getModule, getName, getParameter, getPossibleParameters, getSetableParameters, getSourceChunk, getSourceChunkInternal, getSourceChunks, getSourceChunks, getSourceChunksInternal, handlesEncoding, initialize, isStrictHarvestingEnabled, matched, matchedInternal, removeListener, removeSourceChunk, removeSourceChunkInternal, setActivation, setActivationSpreader, setG, setParameter, setStrictHarvestingEnabled, toString
addAdapterFactory, getAdapter, removeAdapterFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, clear, contains, getActivation, getG, getModel, getModule, getName, getSourceChunk, getSourceChunks, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setG
initialize
getAdapter
public AbstractActivationBuffer6(java.lang.String name, IModule module)
public void dispose()
IActivationBuffer
dispose
in interface IActivationBuffer
dispose
in class AbstractActivationBuffer
protected java.util.Collection<IChunk> clearInternal()
clearInternal
in class AbstractActivationBuffer
AbstractActivationBuffer.clear()
public void addListener(ISlotContainerListener listener, java.util.concurrent.Executor executor)
addListener
in interface INotifyingSlotContainer
public void removeListener(ISlotContainerListener listener)
removeListener
in interface INotifyingSlotContainer
public void valueChanged(ISlot slot, java.lang.Object oldValue, java.lang.Object newValue)
INotifyingSlotContainer
valueChanged
in interface INotifyingSlotContainer
public void addSlot(ISlot slot)
ISlotContainer
addSlot
in interface ISlotContainer
slot
- The feature to be added to the ISlot attributepublic void removeSlot(ISlot slot)
ISlotContainer
removeSlot
in interface ISlotContainer
slot
- Description of Parameterpublic ISlot getSlot(java.lang.String name)
IUniqueSlotContainer
getSlot
in interface IUniqueSlotContainer
public boolean hasSlot(java.lang.String name)
hasSlot
in interface IUniqueSlotContainer
public java.util.Collection<? extends ISlot> getSlots()
ISlotContainer
getSlots
in interface ISlotContainer
public java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
getSlots
in interface ISlotContainer
protected boolean shouldCopyOnInsertion(IChunk chunk)
IChunk.isEncoded()
or
BufferUtilities.getContainingBuffers(IChunk, boolean)
.size()!=0. In
other words, copy the chunk if its been encoded or is currently in another
bufferchunk
- public boolean isStateFree()
isStateFree
in interface IStatusBuffer
public boolean isStateBusy()
isStateBusy
in interface IStatusBuffer
public boolean isStateError()
isStateError
in interface IStatusBuffer
public boolean isBufferUnrequested()
isBufferUnrequested
in interface IStatusBuffer
public boolean isBufferRequested()
isBufferRequested
in interface IStatusBuffer
public boolean isBufferFull()
isBufferFull
in interface IStatusBuffer
public boolean isBufferEmpty()
isBufferEmpty
in interface IStatusBuffer
IStatusBuffer.isBufferEmpty()
protected boolean checkStatusSlotContent(java.lang.String slotName, java.lang.Object value)
protected void setStatusSlotContent(java.lang.String slotName, java.lang.Object value)
public void setStateChunk(IChunk chunk)
setStateChunk
in interface IStatusBuffer
public void setErrorChunk(IChunk chunk)
setErrorChunk
in interface IStatusBuffer
public boolean isErrorSet()
isErrorSet
in interface IStatusBuffer
public void setBufferChunk(IChunk bufferState)
setBufferChunk
in interface IStatusBuffer
public IChunk getFreeChunk()
public IChunk getBusyChunk()
public IChunk getEmptyChunk()
public IChunk getFullChunk()
public IChunk getErrorChunk()
public IChunk getRequestedChunk()
public IChunk getUnrequestedChunk()
protected void grabReferences()
AbstractActivationBuffer
grabReferences
in class AbstractActivationBuffer
public IChunk addSourceChunk(IChunk sourceChunk)
addSourceChunk
in interface IActivationBuffer
addSourceChunk
in class AbstractActivationBuffer
sourceChunk
- chunk to be addedIActivationBuffer.addSourceChunk(org.jactr.core.chunk.IChunk)
protected void sourceChunkCopied(IChunk originalChunk, IChunk nextSourceChunk)
originalChunk
- nextSourceChunk
- protected boolean shouldAcceptAsSource(IChunk futureSourceChunk)
public int bind(SlotBasedRequest request, VariableBindings bindings, boolean isIterative) throws CannotMatchException
IStatusBuffer
bind
in interface IStatusBuffer
CannotMatchException