gov.sandia.cognition.text.term.relation
Class IndexedTermSimilarityRelation

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.text.relation.AbstractRelation<IndexedTerm,IndexedTerm>
          extended by gov.sandia.cognition.text.term.relation.IndexedTermSimilarityRelation
All Implemented Interfaces:
CloneableSerializable, Serializable, Cloneable

public class IndexedTermSimilarityRelation
extends AbstractRelation<IndexedTerm,IndexedTerm>

A relationship between two indexed terms describing their term similarity.

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

Field Summary
protected  double similarity
          The similarity between the two terms.
 
Fields inherited from class gov.sandia.cognition.text.relation.AbstractRelation
source, target
 
Constructor Summary
IndexedTermSimilarityRelation(IndexedTerm source, IndexedTerm target, double similarity)
          Creates a new IndexedTermSimilarityRelation.
 
Method Summary
 boolean equals(IndexedTermSimilarityRelation other)
          Determines if this object is equal to the given object.
 boolean equals(Object other)
           
 double getSimilarity()
          Gets the similarity between the two terms.
 int hashCode()
           
protected  void setSimilarity(double similarity)
          Sets the similarity between the two terms.
 
Methods inherited from class gov.sandia.cognition.text.relation.AbstractRelation
getSource, getTarget, setSource, setTarget
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

similarity

protected double similarity
The similarity between the two terms.

Constructor Detail

IndexedTermSimilarityRelation

public IndexedTermSimilarityRelation(IndexedTerm source,
                                     IndexedTerm target,
                                     double similarity)
Creates a new IndexedTermSimilarityRelation.

Parameters:
source - The source term.
target - The target term.
similarity - The similarity between the terms.
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object

equals

public boolean equals(IndexedTermSimilarityRelation other)
Determines if this object is equal to the given object. They are equal if they have the same source, target, and similarity.

Parameters:
other - Another object.
Returns:
True if the two objects are equal; otherwise, false.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getSimilarity

public double getSimilarity()
Gets the similarity between the two terms.

Returns:
The similarity between the two terms.

setSimilarity

protected void setSimilarity(double similarity)
Sets the similarity between the two terms.

Parameters:
similarity - The similarity between the two terms.