org.jactr.core.chunk.basic
Class BasicSymbolicChunk

java.lang.Object
  extended by org.jactr.core.chunk.basic.BasicSymbolicChunk
All Implemented Interfaces:
ISymbolicChunk, ISlotContainer, IUniqueSlotContainer

public class BasicSymbolicChunk
extends java.lang.Object
implements ISymbolicChunk

default symbolic chunk implementation

Author:
harrison

Constructor Summary
BasicSymbolicChunk(IChunk parentChunk, IChunkType ct)
           
 
Method Summary
 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
 boolean canModify()
          cannot add/remove slots from a chunk
 void dispose()
          clear resources
 void encode(double when)
          no op
 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
 java.util.Collection<? extends ISlot> getSlots()
          return a collection of the ACTUAL slots
 java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
          non-locking since the number of slots never changes
 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.
 void removeSlot(ISlot s)
          noop
 void setName(java.lang.String name)
          set the chunk name, once encoded this will fail
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicSymbolicChunk

public BasicSymbolicChunk(IChunk parentChunk,
                          IChunkType ct)
Method Detail

canModify

public boolean canModify()
cannot add/remove slots from a chunk


dispose

public void dispose()
clear resources

Specified by:
dispose in interface ISymbolicChunk

getParentChunk

public IChunk getParentChunk()
return the IChunk wrapper

Specified by:
getParentChunk in interface ISymbolicChunk
Returns:
The parentChunk value

encode

public void encode(double when)
no op

Specified by:
encode in interface ISymbolicChunk
Parameters:
when - TODO

getName

public java.lang.String getName()
Description copied from interface: ISymbolicChunk
Return the name of the chunk. Each chunk within a model must have a unique name. You may specify a preferred name during chunk creation (via. IModel.createChunk(IChunkType, String)) ? however, if there is a name collision, a unique name will be munged.

Specified by:
getName in interface ISymbolicChunk
Returns:
The chunkName value
See Also:
ISymbolicChunk.getName()

setName

public void setName(java.lang.String name)
set the chunk name, once encoded this will fail

Specified by:
setName in interface ISymbolicChunk
Parameters:
name - The new chunkName value

getChunkType

public IChunkType getChunkType()
Description copied from interface: ISymbolicChunk
Returns the IChunkType of this chunk.

Specified by:
getChunkType in interface ISymbolicChunk
Returns:
The chunkType value
See Also:
ISymbolicChunk.getChunkType()

getSlots

public java.util.Collection<? extends ISlot> getSlots()
return a collection of the ACTUAL slots

Specified by:
getSlots in interface ISlotContainer
Returns:
The slots value
See Also:
ISlotContainer.getSlots()

getSlots

public java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
non-locking since the number of slots never changes

Specified by:
getSlots in interface ISlotContainer
Parameters:
slots -
Returns:
See Also:
ISlotContainer.getSlots(java.util.Collection)

addSlot

public 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

Specified by:
addSlot in interface ISlotContainer
Parameters:
s - The feature to be added to the ISlot attribute

removeSlot

public void removeSlot(ISlot s)
noop

Specified by:
removeSlot in interface ISlotContainer
Parameters:
s - Description of Parameter
See Also:
ISlotContainer.removeSlot(org.jactr.core.slot.ISlot)

isA

public boolean isA(IChunkType ct)
Description copied from interface: ISymbolicChunk
Returns true if the chunk has any parent chunktype of ct.

Specified by:
isA in interface ISymbolicChunk
Parameters:
ct - Description of Parameter
Returns:
The a value
See Also:
ISymbolicChunk.isA(org.jactr.core.chunktype.IChunkType)

isAStrict

public boolean isAStrict(IChunkType ct)
Description copied from interface: ISymbolicChunk
Returns true if and only if the immediate chunktype parent is ct.SymbolicChunk.getChunkType()==ct.

Specified by:
isAStrict in interface ISymbolicChunk
Parameters:
ct - Description of Parameter
Returns:
The aStrict value
See Also:
ISymbolicChunk.isAStrict(org.jactr.core.chunktype.IChunkType)

getSlot

public ISlot getSlot(java.lang.String slotName)
return the actual slot

Specified by:
getSlot in interface IUniqueSlotContainer
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object