| Constructor and Description |
|---|
Score(int nodeA,
int nodeB,
float score,
boolean isMergeable)
Constructs a new
Score instance. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Score other)
Returns -1, 0, or 1 depending on whether this
Score is less
than, equal to, or greater than the specified Score. |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this
Score for
equality. |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
isMergeable()
Returns
true if the two trees may be merged, and
returns false otherwise. |
int |
nodeA()
Returns the root node index for the first tree.
|
int |
nodeB()
Returns the root node index for the second tree.
|
float |
score()
Returns the similarity score for the two trees.
|
java.lang.String |
toString()
Returns a string representation of
this. |
public Score(int nodeA,
int nodeB,
float score,
boolean isMergeable)
Score instance. Smaller similarity scores
correspond to greater similarity.nodeA - root node index for the first treenodeB - root node index for the second treescore - the a non-negative similarity score for the two specified
treesisMergeable - true if the two trees may be
merged, and false otherwisejava.lang.IllegalArgumentException - if
score < 0 || (score==0 && isMergeable==false)java.lang.IllegalArgumentException - if Float.isNaN(score)public int nodeA()
public int nodeB()
public float score()
public boolean isMergeable()
true if the two trees may be merged, and
returns false otherwise.true if the two trees may be merged, and
returns false otherwisepublic boolean equals(java.lang.Object obj)
Score for
equality. Returns true if the specified object
is a Score instance whose nodeA(), nodeB(),
score(), and isMergeable() methods return the
same values as the corresponding methods for this, and
returns false otherwise.equals in class java.lang.Objectobj - the object to be compared for equality with this
Scoretrue if the specified object is a equal to thispublic int hashCode()
Returns the hash code value for this object. The hash code is defined by the following calculation:
int hash = 5;
hash = 53 * hash + this.nodeA();
hash = 53 * hash + this.nodeB();
hash = 53 * hash + Float.floatToIntBits(this.score());
hashCode in class java.lang.Objectpublic int compareTo(Score other)
Score is less
than, equal to, or greater than the specified Score. The
two scores are ordered first using -Boolean.compare() on
the value returned by isMergeable(), then by
Float.compare() on the value returned by score(), then
by the value returned by nodeA(), and then by the value returned
by nodeB().compareTo in interface java.lang.Comparable<Score>other - a Score element to be comparedScore is less than, equal to, or greater
than the specified Scorejava.lang.NullPointerException - if other == nullpublic java.lang.String toString()
this. The exact details of
the representation are unspecified and subject to change.toString in class java.lang.Objectthis