mulan.data
Class LabelsPair

java.lang.Object
  extended by mulan.data.LabelsPair
All Implemented Interfaces:
Serializable, Comparable

public class LabelsPair
extends Object
implements Comparable, Serializable

Class for handling label pairs along with their 'dependence' scores. A pair of labels is represented as an array of two int values. The natural order of label pairs is according to natural order of their dependence scores.

Version:
30.11.2010
Author:
Lena Chekina (lenat@bgu.ac.il)
See Also:
Serialized Form

Constructor Summary
LabelsPair(int[] aPair, double aScore)
          Initialize a labels pair using an array of two int values.
 
Method Summary
 int compareTo(Object otherPair)
           
 boolean equals(Object o)
           
 int[] getPair()
           
 Double getScore()
           
 int hashCode()
           
 void setPair(int[] pair)
           
 void setScore(Double score)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelsPair

public LabelsPair(int[] aPair,
                  double aScore)
Initialize a labels pair using an array of two int values.

Parameters:
aPair - - a pair of labels (i.e. an array of length 2)
aScore - - a dependence score
Method Detail

getPair

public int[] getPair()
Returns:

setPair

public void setPair(int[] pair)
Parameters:
pair -

getScore

public Double getScore()
Returns:

setScore

public void setScore(Double score)
Parameters:
score -

equals

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

compareTo

public int compareTo(Object otherPair)
Specified by:
compareTo in interface Comparable

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string representation of a labels pair in the form: "labels pair: [index1, index2]; dependence score; value"