public class BasicSymbolicChunk extends NotifyingSlotContainer implements ISymbolicChunk, IAdaptable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_chunkName |
protected IChunkType |
_chunkType |
protected IChunk |
_parentChunk |
_useMutable
Constructor and Description |
---|
BasicSymbolicChunk() |
Modifier and Type | Method and Description |
---|---|
void |
addSlot(ISlot s)
will set the value of a slot You cannot add slots to a chunk, only the
chunk-type - but this will set the value, assuming the slot exists
|
void |
bind(IChunk wrapper,
IChunkType type) |
boolean |
canModify()
cannot add/remove slots from a chunk
|
void |
encode(double when)
no op
|
java.lang.Object |
getAdapter(java.lang.Class adapterClass) |
IChunkType |
getChunkType()
Returns the IChunkType of this chunk.
|
java.lang.String |
getName()
Return the name of the chunk.
|
IChunk |
getParentChunk()
return the IChunk wrapper
|
ISlot |
getSlot(java.lang.String slotName)
return the actual slot
|
boolean |
isA(IChunkType ct)
Returns true if the chunk has any parent chunktype of ct.
|
boolean |
isAStrict(IChunkType ct)
Returns true if and only if the immediate chunktype parent is
ct.SymbolicChunk.getChunkType()==ct.
|
protected java.util.concurrent.locks.Lock |
readLock() |
void |
removeSlot(ISlot s)
noop
|
void |
setName(java.lang.String name)
set the chunk name, once encoded this will fail
|
java.lang.String |
toString() |
void |
valueChanged(ISlot slot,
java.lang.Object oldValue,
java.lang.Object newValue)
notify both the slot container listeners and the chunk listeners
|
protected java.util.concurrent.locks.Lock |
writeLock() |
addListener, createSlot, dispose, removeListener, setDelegateContainer
clear, getMutableSlots, getSlots, getSlots, hasSlot
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose
hasSlot
getSlots, getSlots
protected IChunkType _chunkType
protected java.lang.String _chunkName
protected IChunk _parentChunk
public void bind(IChunk wrapper, IChunkType type)
protected java.util.concurrent.locks.Lock readLock()
protected java.util.concurrent.locks.Lock writeLock()
public boolean canModify()
public IChunk getParentChunk()
getParentChunk
in interface ISymbolicChunk
public void encode(double when)
encode
in interface ISymbolicChunk
when
- TODOpublic java.lang.String getName()
ISymbolicChunk
getName
in interface ISymbolicChunk
ISymbolicChunk.getName()
public void setName(java.lang.String name)
setName
in interface ISymbolicChunk
name
- The new chunkName valuepublic IChunkType getChunkType()
ISymbolicChunk
getChunkType
in interface ISymbolicChunk
ISymbolicChunk.getChunkType()
public void addSlot(ISlot s)
addSlot
in interface ISlotContainer
addSlot
in class NotifyingSlotContainer
s
- The feature to be added to the ISlot attributepublic void removeSlot(ISlot s)
removeSlot
in interface ISlotContainer
removeSlot
in class NotifyingSlotContainer
s
- Description of ParameterISlotContainer.removeSlot(org.jactr.core.slot.ISlot)
public boolean isA(IChunkType ct)
ISymbolicChunk
isA
in interface ISymbolicChunk
ct
- Description of ParameterISymbolicChunk.isA(org.jactr.core.chunktype.IChunkType)
public boolean isAStrict(IChunkType ct)
ISymbolicChunk
isAStrict
in interface ISymbolicChunk
ct
- Description of ParameterISymbolicChunk.isAStrict(org.jactr.core.chunktype.IChunkType)
public void valueChanged(ISlot slot, java.lang.Object oldValue, java.lang.Object newValue)
valueChanged
in interface INotifyingSlotContainer
valueChanged
in class NotifyingSlotContainer
public ISlot getSlot(java.lang.String slotName)
getSlot
in interface IUniqueSlotContainer
getSlot
in class UniqueSlotContainer
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object getAdapter(java.lang.Class adapterClass)
getAdapter
in interface IAdaptable