public class DefaultChunk extends DefaultAdaptable implements IChunk
Modifier and Type | Field and Description |
---|---|
protected ISubsymbolicChunk |
_subsymbolicChunk |
protected ISymbolicChunk |
_symbolicChunk |
Constructor and Description |
---|
DefaultChunk(IModel model) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IChunkListener cl,
java.util.concurrent.Executor executor)
note : non-locking
|
void |
addListener(IParameterListener pl,
java.util.concurrent.Executor executor)
note : non-locking
|
void |
bind(ISymbolicChunk symbolicChunk,
ISubsymbolicChunk subsymbolicChunk) |
int |
compareTo(IChunk comparison)
note : non-locking
|
void |
dispatch(ChunkEvent chunkEvent)
dispatch an event.
|
void |
dispatch(ParameterEvent pEvent)
dispatch parameter event
|
void |
dispose()
called when one is sure that this chunk will NEVER be used.
|
void |
encode(double when)
note : non-locking
|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsSymbolic(IChunk chunk)
returns true if the symbolic contents of the two chunks are the same, i.e.
|
java.lang.Object |
getAdapter(java.lang.Class adapterClass) |
java.lang.String |
getComment()
note : non-locking
|
java.lang.Object |
getMetaData(java.lang.String key)
note : non-locking
|
java.util.Collection<java.lang.String> |
getMetaDataKeys()
return all the keys
|
IModel |
getModel()
get the model that is responsible for this chunk, note: the chunk may not
have been encoded yet
|
java.util.concurrent.locks.Lock |
getReadLock()
return the read lock for this chunk.
|
ISubsymbolicChunk |
getSubsymbolicChunk()
return the subsymbolic portion of the chunk
|
ISymbolicChunk |
getSymbolicChunk()
return the symbolic component of the chunk
|
java.util.concurrent.locks.Lock |
getWriteLock()
return the read lock for this chunk.
|
boolean |
hasBeenDisposed()
note : non-locking
|
int |
hashCode() |
boolean |
hasListeners()
note : non-locking
|
boolean |
hasParameterListeners()
note : non-locking
|
boolean |
isA(IChunkType ct)
note : non-locking
|
boolean |
isAStrict(IChunkType ct)
note : non-locking
|
boolean |
isEncoded()
note : non-locking
|
boolean |
isMutable()
note : non-locking
|
void |
mergeInto(IChunk masterChunk)
merge the metadata, this does not affect the symbolic/subsymbolic contents.
|
void |
removeListener(IChunkListener cl)
note : non-locking
|
void |
removeListener(IParameterListener pl)
note : non-locking
|
void |
setComment(java.lang.String comment)
note : non-locking
|
void |
setMetaData(java.lang.String key,
java.lang.Object value)
Sets the MetaData attribute of the MetaContainer object
|
void |
setMutable(boolean isMutable)
note : non-locking
|
java.lang.String |
toString() |
addAdapterFactory, removeAdapterFactory
protected ISubsymbolicChunk _subsymbolicChunk
protected ISymbolicChunk _symbolicChunk
public DefaultChunk(IModel model)
public IModel getModel()
IChunk
getModel
in interface IChunk
IChunk.getModel()
public void dispatch(ChunkEvent chunkEvent)
IChunk
dispatch
in interface IChunk
chunkEvent
- IChunk.dispatch(org.jactr.core.chunk.event.ChunkEvent)
public void dispatch(ParameterEvent pEvent)
IChunk
dispatch
in interface IChunk
pEvent
- IChunk.dispatch(org.jactr.core.event.ParameterEvent)
public boolean hasParameterListeners()
hasParameterListeners
in interface IChunk
IChunk.hasParameterListeners()
public boolean hasListeners()
hasListeners
in interface IChunk
IChunk.hasListeners()
public void addListener(IChunkListener cl, java.util.concurrent.Executor executor)
addListener
in interface IChunk
cl
- executor
- IChunk.addListener(org.jactr.core.chunk.event.IChunkListener,
java.util.concurrent.Executor)
public void addListener(IParameterListener pl, java.util.concurrent.Executor executor)
addListener
in interface IChunk
pl
- executor
- IChunk.addListener(org.jactr.core.event.IParameterListener,
java.util.concurrent.Executor)
public void removeListener(IChunkListener cl)
removeListener
in interface IChunk
cl
- IChunk.removeListener(org.jactr.core.chunk.event.IChunkListener)
public void removeListener(IParameterListener pl)
removeListener
in interface IChunk
pl
- IChunk.removeListener(org.jactr.core.event.IParameterListener)
public void bind(ISymbolicChunk symbolicChunk, ISubsymbolicChunk subsymbolicChunk)
public ISubsymbolicChunk getSubsymbolicChunk()
IChunk
getSubsymbolicChunk
in interface IChunk
public ISymbolicChunk getSymbolicChunk()
IChunk
getSymbolicChunk
in interface IChunk
public void mergeInto(IChunk masterChunk)
masterChunk
- public int compareTo(IChunk comparison)
compareTo
in interface java.lang.Comparable<IChunk>
comparison
- Comparable.compareTo(java.lang.Object)
public void dispose()
IChunk
IDeclarativeModule
. To dispose
of a chunk, use IDeclarativeModule.dispose(IChunk)
insteaddispose
in interface IChunk
IChunk.dispose()
public boolean hasBeenDisposed()
hasBeenDisposed
in interface IChunk
IChunk.hasBeenDisposed()
public void encode(double when)
encode
in interface IChunk
when
- TODOIChunk.encode(double)
public boolean isEncoded()
isEncoded
in interface IChunk
IChunk.isEncoded()
public boolean isA(IChunkType ct)
isA
in interface IChunk
ct
- IChunk.isA(org.jactr.core.chunktype.IChunkType)
public boolean isAStrict(IChunkType ct)
isAStrict
in interface IChunk
ct
- IChunk.isAStrict(org.jactr.core.chunktype.IChunkType)
public void setComment(java.lang.String comment)
setComment
in interface ICommentable
comment
- ICommentable.setComment(java.lang.String)
public java.lang.String getComment()
getComment
in interface ICommentable
ICommentable.getComment()
public java.lang.Object getMetaData(java.lang.String key)
getMetaData
in interface IMetaContainer
key
- IMetaContainer.getMetaData(java.lang.String)
public void setMetaData(java.lang.String key, java.lang.Object value)
IMetaContainer
setMetaData
in interface IMetaContainer
key
- value
- IMetaContainer.setMetaData(java.lang.String,
java.lang.Object)
public java.util.Collection<java.lang.String> getMetaDataKeys()
IMetaContainer
getMetaDataKeys
in interface IMetaContainer
IMetaContainer.getMetaDataKeys()
public boolean isMutable()
isMutable
in interface IChunk
IChunk.isMutable()
public void setMutable(boolean isMutable)
setMutable
in interface IChunk
isMutable
- IChunk.setMutable(boolean)
public boolean equalsSymbolic(IChunk chunk)
IChunk
equalsSymbolic
in interface IChunk
chunk
- cannot be nullIChunk.equalsSymbolic(org.jactr.core.chunk.IChunk)
public final java.util.concurrent.locks.Lock getReadLock()
IChunk
Lock.unlock()
is wrapped within the finally clause.getReadLock
in interface IChunk
IChunk.getReadLock()
public final java.util.concurrent.locks.Lock getWriteLock()
IChunk
Lock.unlock()
is wrapped within the finally clause.getWriteLock
in interface IChunk
IChunk.getWriteLock()
public java.lang.Object getAdapter(java.lang.Class adapterClass)
getAdapter
in interface IAdaptable
getAdapter
in class DefaultAdaptable
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object