gov.sandia.cognition.text.relation
Class AbstractRelation<SourceType,TargetType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.text.relation.AbstractRelation<SourceType,TargetType>
Type Parameters:
SourceType - The type of the source object of the relation.
TargetType - The type of the target object of the relation.
All Implemented Interfaces:
CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
IndexedTermSimilarityRelation

public class AbstractRelation<SourceType,TargetType>
extends AbstractCloneableSerializable

An abstract implementation of a relation between two objects. It holds pointers to the source and target objects.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  SourceType source
          The source object of the relation.
protected  TargetType target
          The target object of the relation.
 
Constructor Summary
AbstractRelation()
          Creates a new AbstractRelation with null source and target.
AbstractRelation(SourceType source, TargetType target)
          Creates a new AbstractRelation with the given source and target.
 
Method Summary
 SourceType getSource()
          Gets the source object of the relation.
 TargetType getTarget()
          Sets the target object of the relation.
protected  void setSource(SourceType source)
          Sets the source object of the relation.
protected  void setTarget(TargetType target)
          Sets the target object of the relation.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected SourceType source
The source object of the relation.


target

protected TargetType target
The target object of the relation.

Constructor Detail

AbstractRelation

public AbstractRelation()
Creates a new AbstractRelation with null source and target.


AbstractRelation

public AbstractRelation(SourceType source,
                        TargetType target)
Creates a new AbstractRelation with the given source and target.

Parameters:
source - The source object of the relation.
target - The target object of the relation.
Method Detail

getSource

public SourceType getSource()
Gets the source object of the relation.

Returns:
The source object of the relation.

setSource

protected void setSource(SourceType source)
Sets the source object of the relation.

Parameters:
source - The source object of the relation.

getTarget

public TargetType getTarget()
Sets the target object of the relation.

Returns:
The target object of the relation.

setTarget

protected void setTarget(TargetType target)
Sets the target object of the relation.

Parameters:
target - The target object of the relation.