org.jactr.core.chunk
Interface IChunk

All Superinterfaces:
Commentable, java.lang.Comparable<IChunk>, IMetaContainer
All Known Implementing Classes:
AbstractChunk, DefaultChunk5

public interface IChunk
extends java.lang.Comparable<IChunk>, Commentable, IMetaContainer

The basic chunk wrapper to contain the symbolic and subsymbolic portions. It is also the point of access for all event notification

Author:
harrison

Method Summary
 void addListener(IChunkListener cl, java.util.concurrent.Executor executor)
          Add a chunk listener to this chunk.
 void addListener(IParameterListener pl, java.util.concurrent.Executor executor)
           
 void dispatch(ChunkEvent chunkEvent)
           
 void dispatch(ParameterEvent parameterEvent)
           
 void dispose()
          called when one is sure that this chunk will NEVER be used.
 void encode()
          flag that this chunk has been encoded
 boolean equalsSymbolic(IChunk chunk)
          returns true if the symbolic contents of the two chunks are the same, i.e.
 IModel getModel()
          get the model that is responsible for this chunk, note: the chunk may not have been encoded yet
 ISubsymbolicChunk getSubsymbolicChunk()
          return the subsymbolic component of the chunk
 ISymbolicChunk getSymbolicChunk()
          return the symbolic component of the chunk
 boolean hasBeenDisposed()
           
 boolean hasListeners()
           
 boolean hasParameterListeners()
           
 boolean isA(IChunkType ct)
          is this chunk a IChunkType
 boolean isAStrict(IChunkType ct)
          is this chunk only a chunktype
 boolean isEncoded()
          has this chunk been encoded?
 boolean isMutable()
          will return true if this chunks slots can be changed after encoding (like visual-location chunks).
 void removeListener(IChunkListener cl)
          removed the listener from both sync and async listeners
 void removeListener(IParameterListener pl)
           
 void setMutable(boolean isMutable)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.jactr.core.utils.Commentable
getComment, setComment
 
Methods inherited from interface org.jactr.core.utils.IMetaContainer
getMetaData, getMetaDataKeys, setMetaData
 

Method Detail

addListener

void addListener(IChunkListener cl,
                 java.util.concurrent.Executor executor)
Add a chunk listener to this chunk. Is asynchronous is true, it will be added to the asynchronous list.


addListener

void addListener(IParameterListener pl,
                 java.util.concurrent.Executor executor)

removeListener

void removeListener(IChunkListener cl)
removed the listener from both sync and async listeners

Parameters:
cl - Description of Parameter
Since:

removeListener

void removeListener(IParameterListener pl)

hasListeners

boolean hasListeners()

hasParameterListeners

boolean hasParameterListeners()

dispatch

void dispatch(ChunkEvent chunkEvent)

dispatch

void dispatch(ParameterEvent parameterEvent)

getSubsymbolicChunk

ISubsymbolicChunk getSubsymbolicChunk()
return the subsymbolic component of the chunk

Returns:
The ISubsymbolicChunk value
Since:

getSymbolicChunk

ISymbolicChunk getSymbolicChunk()
return the symbolic component of the chunk

Returns:
The ISymbolicChunk value
Since:

encode

void encode()
flag that this chunk has been encoded


isEncoded

boolean isEncoded()
has this chunk been encoded?

Returns:

dispose

void dispose()
called when one is sure that this chunk will NEVER be used. should only be called from either IModel.dispose() or chunktype.dispose();

Since:

hasBeenDisposed

boolean hasBeenDisposed()
Returns:
true iff the chunk has been disposed

isA

boolean isA(IChunkType ct)
is this chunk a IChunkType

Parameters:
ct -
Returns:
true if the immediate chunktype or any ancestor is ct

isAStrict

boolean isAStrict(IChunkType ct)
is this chunk only a chunktype

Parameters:
ct -
Returns:
true if the immediate chunktype is ct

isMutable

boolean isMutable()
will return true if this chunks slots can be changed after encoding (like visual-location chunks). These chunks are not searchable by the declarative memory system

Returns:

setMutable

void setMutable(boolean isMutable)

getModel

IModel getModel()
get the model that is responsible for this chunk, note: the chunk may not have been encoded yet

Returns:

equalsSymbolic

boolean equalsSymbolic(IChunk chunk)
returns true if the symbolic contents of the two chunks are the same, i.e. same chunktype and slot values

Parameters:
chunk - cannot be null
Returns:
true if they are the same symbolically