public interface IDeclarativeModule extends IModule
AbstractDeclarativeModule
or DefaultDeclarativeModule
. In
either case, when the module makes calls to its front facing methods, it
should not assume that it is in the installed declarative memory module.
Rather it should use IModule.getModel()
and
IModel.getDeclarativeModule()
. This permits the local decM to be
wrapped by a delegating one (say to access external database stores).Future
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<IChunk> |
addChunk(IChunk chunk)
add this chunk to the model and optionally check for duplicates so that it
can be merged if necessary
|
java.util.concurrent.CompletableFuture<IChunkType> |
addChunkType(IChunkType chunkType)
add the chunktype to the model.
|
void |
addListener(IDeclarativeModuleListener listener,
java.util.concurrent.Executor executor) |
java.util.concurrent.CompletableFuture<IChunk> |
copyChunk(IChunk sourceChunk)
return a copy of source chunk
|
java.util.concurrent.CompletableFuture<IChunk> |
copyChunk(IChunk sourceChunk,
boolean copySubsymbolics) |
java.util.concurrent.CompletableFuture<IChunk> |
createChunk(IChunkType parent,
java.lang.String name)
create a chunk to later be inserted.
|
java.util.concurrent.CompletableFuture<IChunkType> |
createChunkType(java.util.Collection<IChunkType> parents,
java.lang.String name)
create a new chunktype to be added after its symbolic contents have been
set.
|
java.util.concurrent.CompletableFuture<IChunkType> |
createChunkType(IChunkType parent,
java.lang.String name) |
void |
dispose(IChunk chunk)
request that this chunk be disposed.
|
java.util.concurrent.CompletableFuture<java.util.Collection<IChunk>> |
findExactMatches(ChunkTypeRequest request,
java.util.Comparator<IChunk> sorter,
IChunkFilter filter)
search DM for all the chunks that match pattern, sorting using sorter, that
are above activationThreshold
|
java.util.concurrent.CompletableFuture<java.util.Collection<IChunk>> |
findPartialMatches(ChunkTypeRequest request,
java.util.Comparator<IChunk> sorter,
IChunkFilter filter)
search DM for all the chunks that partially match
|
void |
flush()
force all pending deferred operations to execute (dispose, encode, etc)
|
IAssociativeLinkageSystem |
getAssociativeLinkageSystem()
code responsible for the setting up and maintaining of associative links,
may be null.
|
IChunk |
getBusyChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
java.util.concurrent.CompletableFuture<IChunk> |
getChunk(java.lang.String name)
return the named chunk, case insensitive but preserving
|
java.util.concurrent.CompletableFuture<java.util.Collection<IChunk>> |
getChunks()
return all chunks.
|
java.util.concurrent.CompletableFuture<IChunkType> |
getChunkType(java.lang.String name)
return the named chunktype.
|
java.util.concurrent.CompletableFuture<java.util.Collection<IChunkType>> |
getChunkTypes()
return all the chunk types in this model
|
IChunk |
getEmptyChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
IChunk |
getErrorChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
IChunk |
getFreeChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
IChunk |
getFullChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
IChunk |
getNewChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
long |
getNumberOfChunks()
return the number of chunks in the model.
|
IChunk |
getRequestedChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
IChunk |
getUnrequestedChunk()
snag the busy chunk.
Note : this should not be called by the declarative memory module if the retrieval will access the future methods as it might result in deadlock. |
void |
removeListener(IDeclarativeModuleListener listener) |
void |
setAssociativeLinkageSystem(IAssociativeLinkageSystem linkageSystem)
the code responsible for linking memories.
|
boolean |
willEncode(IChunk chunk)
because encoding might be async, we need a method to determine if a given
chunk is scheduled for encoding
|
dispose, getModel, getName, initialize, install, reset
uninstall
getAdapter
java.util.concurrent.CompletableFuture<IChunkType> createChunkType(java.util.Collection<IChunkType> parents, java.lang.String name)
parent
- maybe nullname
- java.util.concurrent.CompletableFuture<IChunkType> createChunkType(IChunkType parent, java.lang.String name)
java.util.concurrent.CompletableFuture<IChunkType> addChunkType(IChunkType chunkType)
chunkType
- java.util.concurrent.CompletableFuture<IChunkType> getChunkType(java.lang.String name)
name
- java.util.concurrent.CompletableFuture<java.util.Collection<IChunkType>> getChunkTypes()
java.util.concurrent.CompletableFuture<IChunk> createChunk(IChunkType parent, java.lang.String name)
parent
- must not be null (duh)name
- void dispose(IChunk chunk)
chunk
- IAssociativeLinkageSystem getAssociativeLinkageSystem()
void setAssociativeLinkageSystem(IAssociativeLinkageSystem linkageSystem)
linkageSystem
- java.util.concurrent.CompletableFuture<IChunk> copyChunk(IChunk sourceChunk)
sourceChunk
- java.util.concurrent.CompletableFuture<IChunk> copyChunk(IChunk sourceChunk, boolean copySubsymbolics)
java.util.concurrent.CompletableFuture<IChunk> addChunk(IChunk chunk)
chunk
- checkForDuplicates
- boolean willEncode(IChunk chunk)
chunk
- java.util.concurrent.CompletableFuture<IChunk> getChunk(java.lang.String name)
name
- java.util.concurrent.CompletableFuture<java.util.Collection<IChunk>> getChunks()
long getNumberOfChunks()
java.util.concurrent.CompletableFuture<java.util.Collection<IChunk>> findExactMatches(ChunkTypeRequest request, java.util.Comparator<IChunk> sorter, IChunkFilter filter)
request
- sorter
- sort order, may be nullfilter
- filter function, may be nulljava.util.concurrent.CompletableFuture<java.util.Collection<IChunk>> findPartialMatches(ChunkTypeRequest request, java.util.Comparator<IChunk> sorter, IChunkFilter filter)
request
- sorter
- may be nullfilter
- TODOIChunk getBusyChunk()
IChunk getEmptyChunk()
IChunk getErrorChunk()
IChunk getFreeChunk()
IChunk getFullChunk()
IChunk getNewChunk()
IChunk getRequestedChunk()
IChunk getUnrequestedChunk()
void flush()
void addListener(IDeclarativeModuleListener listener, java.util.concurrent.Executor executor)
void removeListener(IDeclarativeModuleListener listener)