public abstract class AbstractCapacityBuffer6 extends AbstractRequestableBuffer6 implements ICapacityBuffer
ICapacityBuffer.EjectionPolicy
Modifier and Type | Field and Description |
---|---|
protected ICapacityBuffer.EjectionPolicy |
_ejectionPolicy |
ACTIVATION_PARAM, GOAL_VALUE_PARAM, STRICT_HARVESTING_PARAM
EJECTION_POLICY_PARAM
AURAL, AURAL_LOCATION, GOAL, IMAGINAL, MOTOR, RETRIEVAL, VISUAL, VISUAL_LOCATION, VOCAL
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
Constructor and Description |
---|
AbstractCapacityBuffer6(java.lang.String name,
IModule module) |
Modifier and Type | Method and Description |
---|---|
protected IChunk |
addSourceChunkInternal(IChunk chunkToInsert)
return the source chunk that was actually inserted into the buffer (i.e.
|
protected void |
chunkInserted(IChunk insertedChunk)
set the status slots after insertion
|
protected void |
chunkRemoved(IChunk removedChunk) |
void |
dispose()
clean up resources, called by the module that created the buffer
|
protected java.util.Map<IChunk,java.lang.Double> |
getChunksAndTimes() |
ICapacityBuffer.EjectionPolicy |
getEjectionPolicy() |
java.lang.String |
getParameter(java.lang.String key)
return parameter value - null if not defined.
|
java.util.Collection<java.lang.String> |
getPossibleParameters()
Return all parameters that can be read
|
java.util.Collection<java.lang.String> |
getSetableParameters()
Return list of all parameters that can be set.
|
protected IChunk |
getSourceChunkInternal()
return the first source chunk.
|
protected java.util.Collection<IChunk> |
getSourceChunksInternal(java.util.Collection<IChunk> container)
return the contents of the buffer.
|
protected java.util.Map<java.lang.Double,IChunk> |
getTimesAndChunks()
returns the actual backing map used.
|
void |
initialize()
intialize this component
|
protected abstract boolean |
isCapacityReached()
return true if the capacity has been reached and someone needs to be
removed
|
protected abstract boolean |
isValidChunkType(IChunkType chunkType)
return true if a chunk of this type can be added to the buffer
|
protected boolean |
matchedInternal(IChunk chunk)
when a chunk is matched against, we modify its insertion time..
|
protected boolean |
removeSourceChunkInternal(IChunk chunkToRemove)
do the actual work of removing chunkToRemove from the buffer.
|
void |
setEjectionPolicy(ICapacityBuffer.EjectionPolicy policy) |
void |
setParameter(java.lang.String key,
java.lang.String value)
Set the named parameter
|
request, requestInternal
addListener, addSlot, addSourceChunk, bind, checkStatusSlotContent, clearInternal, getBusyChunk, getEmptyChunk, getErrorChunk, getFreeChunk, getFullChunk, getRequestedChunk, getSlot, getSlots, getSlots, getUnrequestedChunk, grabReferences, hasSlot, isBufferEmpty, isBufferFull, isBufferRequested, isBufferUnrequested, isErrorSet, isStateBusy, isStateError, isStateFree, removeListener, removeSlot, setBufferChunk, setErrorChunk, setStateChunk, setStatusSlotContent, shouldAcceptAsSource, shouldCopyOnInsertion, sourceChunkCopied, valueChanged
addListener, clear, contains, containsExact, getActivation, getActivationSpreader, getEventDispatcher, getG, getLock, getModel, getModule, getName, getSourceChunk, getSourceChunks, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setActivationSpreader, setG, setStrictHarvestingEnabled, toString
addAdapterFactory, getAdapter, removeAdapterFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSourceChunks
addListener, addSourceChunk, clear, contains, getActivation, getG, getModel, getModule, getName, getSourceChunk, getSourceChunks, handlesEncoding, isStrictHarvestingEnabled, matched, removeListener, removeSourceChunk, setActivation, setG
getAdapter
willAccept
protected ICapacityBuffer.EjectionPolicy _ejectionPolicy
public AbstractCapacityBuffer6(java.lang.String name, IModule module)
public void initialize()
IInitializable
initialize
in interface IInitializable
initialize
in class AbstractActivationBuffer
public void dispose()
IActivationBuffer
dispose
in interface IActivationBuffer
dispose
in class AbstractActivationBuffer6
protected abstract boolean isCapacityReached()
protected abstract boolean isValidChunkType(IChunkType chunkType)
protected java.util.Map<java.lang.Double,IChunk> getTimesAndChunks()
protected java.util.Map<IChunk,java.lang.Double> getChunksAndTimes()
protected IChunk addSourceChunkInternal(IChunk chunkToInsert)
AbstractActivationBuffer
addSourceChunkInternal
in class AbstractActivationBuffer
chunkToInsert
- the chunk to be inserted, will never be null nor already in the
bufferprotected void chunkInserted(IChunk insertedChunk)
insertedChunk
- protected IChunk getSourceChunkInternal()
getSourceChunkInternal
in class AbstractActivationBuffer
protected java.util.Collection<IChunk> getSourceChunksInternal(java.util.Collection<IChunk> container)
getSourceChunksInternal
in class AbstractActivationBuffer
protected boolean removeSourceChunkInternal(IChunk chunkToRemove)
AbstractActivationBuffer
removeSourceChunkInternal
in class AbstractActivationBuffer
chunkToRemove
- chunk that is in the buffer, never nullprotected void chunkRemoved(IChunk removedChunk)
protected boolean matchedInternal(IChunk chunk)
matchedInternal
in class AbstractActivationBuffer
public ICapacityBuffer.EjectionPolicy getEjectionPolicy()
getEjectionPolicy
in interface ICapacityBuffer
public void setEjectionPolicy(ICapacityBuffer.EjectionPolicy policy)
setEjectionPolicy
in interface ICapacityBuffer
public java.util.Collection<java.lang.String> getPossibleParameters()
IParameterized
getPossibleParameters
in interface IParameterized
getPossibleParameters
in class AbstractActivationBuffer
IParameterized.getPossibleParameters()
public java.util.Collection<java.lang.String> getSetableParameters()
IParameterized
getSetableParameters
in interface IParameterized
getSetableParameters
in class AbstractActivationBuffer
IParameterized.getSetableParameters()
public java.lang.String getParameter(java.lang.String key)
IParameterized
getParameter
in interface IParameterized
getParameter
in class AbstractActivationBuffer
key
- Description of the ParameterIParameterized.getParameter(java.lang.String)
public void setParameter(java.lang.String key, java.lang.String value)
IParameterized
setParameter
in interface IParameterized
setParameter
in class AbstractActivationBuffer
IParameterized.setParameter(java.lang.String,
String)