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

java.lang.Object
  extended by edu.memphis.ccrg.lida.framework.shared.activation.ActivatibleImpl
      extended by edu.memphis.ccrg.lida.framework.shared.LinkImpl
All Implemented Interfaces:
Initializable, Activatible, Link, Linkable, java.io.Serializable
Direct Known Subclasses:
PamLinkImpl

public class LinkImpl
extends ActivatibleImpl
implements Link

A Link that connects a Node to a Linkable (Node or Link).

Author:
Ryan J. McCall, Javier Snaider
See Also:
Serialized Form

Field Summary
protected  PamLink groundingPamLink
          PamLink in PAM that grounds this Link.
 
Fields inherited from interface edu.memphis.ccrg.lida.framework.shared.activation.Activatible
DEFAULT_ACTIVATIBLE_REMOVAL_THRESHOLD, DEFAULT_ACTIVATION
 
Constructor Summary
LinkImpl()
          Default constructor
LinkImpl(LinkImpl l)
          Copy constructor
LinkImpl(Node source, Linkable sink, LinkCategory category)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          This method compares this LinkImpl with any kind of Link.
 LinkCategory getCategory()
          Get LinkCategory of this link.
 ExtendedId getExtendedId()
          Gets extendedId.
 PamLink getGroundingPamLink()
          Get the grounding PamLink for this link.
 java.lang.String getLabel()
          Gets label.
 java.lang.Object getParam(java.lang.String name, java.lang.Object defaultValue)
          A convenience method to read parameters from the Map of properties set with the init() method.
 Linkable getSink()
          One end of the link which receives activation from the source.
 Node getSource()
          One end of the link which provides activation to the sink.
 int hashCode()
           
 void init()
          This is a convenience method to initialize this Object.
 void init(java.util.Map<java.lang.String,?> params)
          This method initializes the module with parameters specified in agent.xml
 boolean isSimpleLink()
          Returns whether Link is Simple (connects two nodes)
 void setCategory(LinkCategory category)
          Set LinkCategory.
 void setGroundingPamLink(PamLink l)
          Set the grounding PamLink for this link.
 void setSink(Linkable sink)
          Set sink linkable.
 void setSource(Node source)
          Set source linkable.
 java.lang.String toString()
           
 void updateLinkValues(Link link)
          Updates the values of this LinkImpl based on the passed in Link.
 
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 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

groundingPamLink

protected PamLink groundingPamLink
PamLink in PAM that grounds this Link.

Constructor Detail

LinkImpl

public LinkImpl()
Default constructor


LinkImpl

public LinkImpl(Node source,
                Linkable sink,
                LinkCategory category)
Parameters:
source - source Node
sink - sink Linkable
category - link's LinkCategory

LinkImpl

public LinkImpl(LinkImpl l)
Copy constructor

Parameters:
l - source LinkImpl
Method Detail

init

public void init(java.util.Map<java.lang.String,?> params)
Description copied from interface: Initializable
This method initializes the module with parameters specified in agent.xml

Specified by:
init in interface Initializable
Parameters:
params - Map of parameters indexed by String names

init

public void init()
Description copied from interface: Initializable
This is a convenience method to initialize this Object. It is called from init(Map parameters). Subclasses can overwrite this method in order to initialize this Object. But make sure to call super.init(); at the beginning of the implementation of this method.

Specified by:
init in interface Initializable

getParam

public java.lang.Object getParam(java.lang.String name,
                                 java.lang.Object defaultValue)
Description copied from interface: Initializable
A convenience method to read parameters from the Map of properties set with the init() method.

Specified by:
getParam in interface Initializable
Parameters:
name - the parameter name
defaultValue - the default value to be returned if the parameter doesn't exist.
Returns:
the value of the parameter or the default value.

getExtendedId

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

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

getSink

public Linkable getSink()
Description copied from interface: Link
One end of the link which receives activation from the source.

Specified by:
getSink in interface Link
Returns:
sink linkable

getSource

public Node getSource()
Description copied from interface: Link
One end of the link which provides activation to the sink.

Specified by:
getSource in interface Link
Returns:
source linkable

getCategory

public LinkCategory getCategory()
Description copied from interface: Link
Get LinkCategory of this link.

Specified by:
getCategory in interface Link
Returns:
the category

setSink

public void setSink(Linkable sink)
Description copied from interface: Link
Set sink linkable.

Specified by:
setSink in interface Link
Parameters:
sink - the new sink

setSource

public void setSource(Node source)
Description copied from interface: Link
Set source linkable.

Specified by:
setSource in interface Link
Parameters:
source - the new source

setCategory

public void setCategory(LinkCategory category)
Description copied from interface: Link
Set LinkCategory.

Specified by:
setCategory in interface Link
Parameters:
category - the new category

getGroundingPamLink

public PamLink getGroundingPamLink()
Description copied from interface: Link
Get the grounding PamLink for this link.

Specified by:
getGroundingPamLink in interface Link
Returns:
the grounding pam link

setGroundingPamLink

public void setGroundingPamLink(PamLink l)
Description copied from interface: Link
Set the grounding PamLink for this link.

Specified by:
setGroundingPamLink in interface Link
Parameters:
l - the new grounding pam link

equals

public boolean equals(java.lang.Object obj)
This method compares this LinkImpl with any kind of Link. Two Links are equal if and only if they have the same id.

Overrides:
equals in class java.lang.Object

hashCode

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

getLabel

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

Specified by:
getLabel in interface Linkable
Returns:
readable label

toString

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

isSimpleLink

public boolean isSimpleLink()
Description copied from interface: Link
Returns whether Link is Simple (connects two nodes)

Specified by:
isSimpleLink in interface Link
Returns:
true if simple, false if complex (between a node and a simple link).

updateLinkValues

public void updateLinkValues(Link link)
Updates the values of this LinkImpl based on the passed in Link. Link must be a LinkImpl. Does not copy superclass attributes, e.g. ActivatibleImpl, only those of this class.

Specified by:
updateLinkValues in interface Link
Parameters:
link - Link whose values are used to update with.