edu.memphis.ccrg.lida.framework.shared
Class NodeImpl

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
      extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
          extended by edu.memphis.ccrg.lida.framework.shared.NodeImpl
All Implemented Interfaces:
Initializable, Activatible, Linkable, Node, Condition
Direct Known Subclasses:
PamNodeImpl, RootableNodeImpl

public class NodeImpl
extends ActivatibleImpl
implements Node

Default Node implementation.

Author:
Javier Snaider, Ryan J. McCall
See Also:
ElementFactory

Field Summary
protected  PamNode groundingPamNode
          PamNode in PerceptualAssociativeMemory which grounds this Node
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
DEFAULT_ACTIVATIBLE_REMOVAL_THRESHOLD, DEFAULT_ACTIVATION
 
Constructor Summary
NodeImpl()
          Default constructor
NodeImpl(NodeImpl n)
          Deprecated. Use ElementFactory.getNode(Node) instead.
 
Method Summary
 boolean equals(java.lang.Object o)
          This method compares this object with any kind of Node.
 ExtendedId getConditionId()
          Gets id.
 ExtendedId getExtendedId()
          Gets extendedId.
 java.lang.String getFactoryType()
          Gets factory type
 PamNode getGroundingPamNode()
          Returns the grounding PamNode.
 int getId()
          Returns Node's id
 java.lang.String getLabel()
          Gets label.
 int hashCode()
           
 void setExtendedId(ExtendedId eid)
          Convenience method to set Node's ExtendedId.
 void setFactoryType(java.lang.String n)
          Sets factory type
 void setGroundingPamNode(PamNode n)
          Used by factory to set the underlying PamNode for this node
 void setId(int id)
          Sets Node's id
 void setLabel(java.lang.String l)
          Sets label
 java.lang.String toString()
           
 void updateNodeValues(Node n)
          This default implementation of Node has all of its attributes updated by NodeStructureImpl or ElementFactory when nodes are updated.
 
Methods inherited from class edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
decay, excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 
Methods inherited from class edu.memphis.ccrg.lida.framework.initialization.InitializableImpl
containsParameter, getParam, getParameters, init, init
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
decay, excite, getActivatibleRemovalThreshold, getActivation, getDecayStrategy, getExciteStrategy, getTotalActivation, isRemovable, setActivatibleRemovalThreshold, setActivation, setDecayStrategy, setExciteStrategy
 

Field Detail

groundingPamNode

protected PamNode groundingPamNode
PamNode in PerceptualAssociativeMemory which grounds this Node

Constructor Detail

NodeImpl

public NodeImpl()
Default constructor


NodeImpl

@Deprecated
public NodeImpl(NodeImpl n)
Deprecated. Use ElementFactory.getNode(Node) instead.

Copy constructor.

Parameters:
n - source NodeImpl
Method Detail

setFactoryType

public void setFactoryType(java.lang.String n)
Description copied from interface: Linkable
Sets factory type

Specified by:
setFactoryType in interface Linkable
Parameters:
n - the factory type of the Linkable
See Also:
ElementFactory

getFactoryType

public java.lang.String getFactoryType()
Description copied from interface: Linkable
Gets factory type

Specified by:
getFactoryType in interface Linkable
Returns:
the factory type of the Linkable
See Also:
ElementFactory

setId

public void setId(int id)
Description copied from interface: Node
Sets Node's id

Specified by:
setId in interface Node
Parameters:
id - unique id

setExtendedId

public void setExtendedId(ExtendedId eid)
Convenience method to set Node's ExtendedId. Also sets node's id.

Parameters:
eid - ExtendedId

getExtendedId

public ExtendedId getExtendedId()
Description copied from interface: Linkable
Gets extendedId.

Specified by:
getExtendedId in interface Linkable
Returns:
a general id for Linkables.

getId

public int getId()
Description copied from interface: Node
Returns Node's id

Specified by:
getId in interface Node
Returns:
unique id

getLabel

public java.lang.String getLabel()
Description copied from interface: Linkable
Gets label.

Specified by:
getLabel in interface Linkable
Specified by:
getLabel in interface Node
Returns:
readable label

setLabel

public void setLabel(java.lang.String l)
Description copied from interface: Node
Sets label

Specified by:
setLabel in interface Node
Parameters:
l - readable label

getGroundingPamNode

public PamNode getGroundingPamNode()
Description copied from interface: Node
Returns the grounding PamNode.

Specified by:
getGroundingPamNode in interface Node
Returns:
PamNode, in PAM, underlying this node.

setGroundingPamNode

public void setGroundingPamNode(PamNode n)
Description copied from interface: Node
Used by factory to set the underlying PamNode for this node

Specified by:
setGroundingPamNode in interface Node
Parameters:
n - PamNode

equals

public boolean equals(java.lang.Object o)
This method compares this object with any kind of Node. returns true if the id of both are the same.

Overrides:
equals in class java.lang.Object
Parameters:
o - Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

updateNodeValues

public void updateNodeValues(Node n)
This default implementation of Node has all of its attributes updated by NodeStructureImpl or ElementFactory when nodes are updated. Therefore this class does not have to implement this method. Any subclass with specific class members (e.g. PamNodeImpl) should however override this method.

Specified by:
updateNodeValues in interface Node
Parameters:
n - Node whose values are used to update with.
See Also:
PamNodeImpl.updateNodeValues(Node), NodeStructureImpl.addNode(Node, String)

getConditionId

public ExtendedId getConditionId()
Description copied from interface: Condition
Gets id. The return object must be unique and it must be able to use as a map key i.e. Object.equals(Object) and Object.hashCode() must be overwritten for this id.

Specified by:
getConditionId in interface Condition
Returns:
Condition's unique id