org.jactr.core.chunktype.basic
Class BasicSymbolicChunkType

java.lang.Object
  extended by org.jactr.core.chunktype.basic.BasicSymbolicChunkType
All Implemented Interfaces:
ISymbolicChunkType, ISlotContainer, IUniqueSlotContainer

public class BasicSymbolicChunkType
extends java.lang.Object
implements ISymbolicChunkType

default impl. All slots and parenting must be resolved before the given chunktype is encoded. parents must be encoded as well. chunks, however, can be added after encoding

Author:
harrison

Constructor Summary
BasicSymbolicChunkType(AbstractChunkType parentChunkType, IChunkType superParentType)
           
 
Method Summary
 void addChild(IChunkType ct)
          add a chunktype as a child,
 void addChunk(IChunk c)
          add this chunk to this chunktype and then up the parental hierachy
 void addSlot(ISlot s)
          Adds a feature to the ISlot attribute of the DefaultSymbolicChunkType5 object
 boolean canModify()
          Yes, you can modify the slots (add/remove) but off if not encoded
 void dispose()
          Description of the Method
 void encode()
           
 java.util.Collection<IChunkType> getChildren()
          return all the chunktypes that are directly decended from this one
 java.util.Collection<IChunk> getChunks()
          return all chunks of this type
 java.lang.String getName()
          Return the unique chunktype name.
 int getNumberOfChildren()
          Gets the numberOfChildren attribute of the ISymbolicChunkType object
 int getNumberOfChunks()
          Gets the numberOfChunks attribute of the ISymbolicChunkType object
 IChunkType getParent()
          Return the immediate parent of this chunktype
 ISlot getSlot(java.lang.String name)
          return the actual named slot.
 java.util.Collection<? extends ISlot> getSlots()
          return all slots
 java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
           
 boolean hasSlot(ISlot s)
           
 boolean isA(IChunkType ct)
           
 boolean isAuthoritative(ISlot slot)
          Gets the authoritative attribute of the DefaultSymbolicChunkType5 object
 void removeSlot(ISlot s)
          Description of the Method
 void setName(java.lang.String name)
          Set the chunktype name.
 java.lang.String toString()
          Description of the Method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicSymbolicChunkType

public BasicSymbolicChunkType(AbstractChunkType parentChunkType,
                              IChunkType superParentType)
Method Detail

dispose

public void dispose()
Description copied from interface: ISymbolicChunkType
Description of the Method

Specified by:
dispose in interface ISymbolicChunkType

getParent

public IChunkType getParent()
Description copied from interface: ISymbolicChunkType
Return the immediate parent of this chunktype

Specified by:
getParent in interface ISymbolicChunkType
Returns:
The parent value
See Also:
ISymbolicChunkType.getParent()

getName

public java.lang.String getName()
Description copied from interface: ISymbolicChunkType
Return the unique chunktype name. All chunktypes, like chunks, must have unique names.

Specified by:
getName in interface ISymbolicChunkType
Returns:
The chunkTypeName value
See Also:
ISymbolicChunkType.getName()

setName

public void setName(java.lang.String name)
Description copied from interface: ISymbolicChunkType
Set the chunktype name. This should only be called once ? reseting the name after the model has added the chunktype can have unpredictable results.

Specified by:
setName in interface ISymbolicChunkType
Parameters:
name - The new chunkTypeName value

getChildren

public java.util.Collection<IChunkType> getChildren()
return all the chunktypes that are directly decended from this one

Specified by:
getChildren in interface ISymbolicChunkType
Returns:
The children value

getNumberOfChildren

public int getNumberOfChildren()
Description copied from interface: ISymbolicChunkType
Gets the numberOfChildren attribute of the ISymbolicChunkType object

Specified by:
getNumberOfChildren in interface ISymbolicChunkType
Returns:
The numberOfChildren value

addChild

public void addChild(IChunkType ct)
Description copied from interface: ISymbolicChunkType
add a chunktype as a child,

Specified by:
addChild in interface ISymbolicChunkType
See Also:
ISymbolicChunkType.addChild(org.jactr.core.chunktype.IChunkType)

getChunks

public java.util.Collection<IChunk> getChunks()
return all chunks of this type

Specified by:
getChunks in interface ISymbolicChunkType
Returns:
The chunks value

addChunk

public void addChunk(IChunk c)
add this chunk to this chunktype and then up the parental hierachy

Specified by:
addChunk in interface ISymbolicChunkType
See Also:
ISymbolicChunkType.addChunk(org.jactr.core.chunk.IChunk)

getNumberOfChunks

public int getNumberOfChunks()
Description copied from interface: ISymbolicChunkType
Gets the numberOfChunks attribute of the ISymbolicChunkType object

Specified by:
getNumberOfChunks in interface ISymbolicChunkType
Returns:
The numberOfChunks value

getSlots

public java.util.Collection<? extends ISlot> getSlots()
return all slots

Specified by:
getSlots in interface ISlotContainer
Returns:
The slots value

getSlots

public java.util.Collection<ISlot> getSlots(java.util.Collection<ISlot> slots)
Specified by:
getSlots in interface ISlotContainer

hasSlot

public boolean hasSlot(ISlot s)

canModify

public boolean canModify()
Yes, you can modify the slots (add/remove) but off if not encoded


getSlot

public ISlot getSlot(java.lang.String name)
Description copied from interface: IUniqueSlotContainer
return the actual named slot. this is the backing slot, changes to it are propogated throughout the model

Specified by:
getSlot in interface IUniqueSlotContainer
Returns:

isAuthoritative

public boolean isAuthoritative(ISlot slot)
Gets the authoritative attribute of the DefaultSymbolicChunkType5 object

Parameters:
slot - Description of the Parameter
Returns:
The authoritative value

addSlot

public void addSlot(ISlot s)
Adds a feature to the ISlot attribute of the DefaultSymbolicChunkType5 object

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

removeSlot

public void removeSlot(ISlot s)
Description of the Method

Specified by:
removeSlot in interface ISlotContainer
Parameters:
s - Description of Parameter
Since:

isA

public boolean isA(IChunkType ct)
Specified by:
isA in interface ISymbolicChunkType
Returns:
true if this chunktype is ct or derived from ct

toString

public java.lang.String toString()
Description of the Method

Overrides:
toString in class java.lang.Object
Returns:
Description of the Return Value

encode

public void encode()
Specified by:
encode in interface ISymbolicChunkType