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

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.LinkImpl
All Implemented Interfaces:
Initializable, Activatible, Link, Linkable
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:
ElementFactory

Field Summary
protected  PamLink groundingPamLink
          PamLink in a PerceptualAssociativeMemory 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)
          Deprecated. Use ElementFactory.getLink(String, Node, Linkable, LinkCategory, String, String, double, double) instead.
LinkImpl(Node src, Linkable snk, LinkCategory cat)
          Deprecated. Use ElementFactory.getLink(Node, Linkable, LinkCategory) instead.
 
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.
 java.lang.String getFactoryType()
          Gets factory type
 PamLink getGroundingPamLink()
          Get the grounding PamLink for this link.
 java.lang.String getLabel()
          Gets label.
 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()
           
 boolean isSimpleLink()
          Returns whether Link is Simple (connects two nodes)
 void setCategory(LinkCategory c)
          Set LinkCategory.
 void setFactoryType(java.lang.String t)
          Sets factory type
 void setGroundingPamLink(PamLink l)
          Set the grounding PamLink for this link.
 void setSink(Linkable snk)
          Set sink linkable.
 void setSource(Node src)
          Set source linkable.
 java.lang.String toString()
           
 void updateLinkValues(Link l)
          This default implementation of Link has all of its attributes updated by NodeStructureImpl when links 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
 
Methods inherited from interface edu.memphis.ccrg.lida.framework.initialization.Initializable
containsParameter, getParam, getParameters, init, init
 

Field Detail

groundingPamLink

protected PamLink groundingPamLink
PamLink in a PerceptualAssociativeMemory that grounds this Link.

Constructor Detail

LinkImpl

public LinkImpl()
Default constructor


LinkImpl

@Deprecated
public LinkImpl(Node src,
                           Linkable snk,
                           LinkCategory cat)
Deprecated. Use ElementFactory.getLink(Node, Linkable, LinkCategory) instead.

Constructs a new Link with specified parameters.

Parameters:
src - source Node
snk - sink Linkable
cat - link's LinkCategory

LinkImpl

@Deprecated
public LinkImpl(LinkImpl l)
Deprecated. Use ElementFactory.getLink(String, Node, Linkable, LinkCategory, String, String, double, double) instead.

Copy constructor

Parameters:
l - source LinkImpl
Method Detail

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 snk)
Description copied from interface: Link
Set sink linkable.

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

setSource

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

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

setCategory

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

Specified by:
setCategory in interface Link
Parameters:
c - 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 l)
This default implementation of Link has all of its attributes updated by NodeStructureImpl when links are updated. Therefore this class does not have to implement this method. Any subclass with specific class members (e.g. PamLinkImpl) should however override this method.

Specified by:
updateLinkValues in interface Link
Parameters:
l - Link whose values are used to update with.
See Also:
PamLinkImpl.updateLinkValues(Link), NodeStructureImpl.addLink(Link, String), NodeStructureImpl.getNewLink(Link, String, Node, Linkable, LinkCategory)

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

setFactoryType

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

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