|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cloud9.io.pair.PairOfFloatInt
public class PairOfFloatInt
WritableComparable representing a pair consisting of a float and an int. The elements in the pair are referred to as the left element (the float) and right element (the int). The natural sort order is: first by the left element, and then by the right element.
| Nested Class Summary | |
|---|---|
static class |
PairOfFloatInt.Comparator
Comparator optimized for PairOfFloatInt. |
| Constructor Summary | |
|---|---|
PairOfFloatInt()
Creates a pair. |
|
PairOfFloatInt(float left,
int right)
Creates a pair. |
|
| Method Summary | |
|---|---|
PairOfFloatInt |
clone()
Clones this object. |
int |
compareTo(PairOfFloatInt obj)
Defines a natural sort order for pairs. |
boolean |
equals(Object obj)
Checks two pairs for equality. |
float |
getKey()
Returns the key (left element). |
float |
getLeftElement()
Returns the left element. |
int |
getRightElement()
Returns the right element. |
int |
getValue()
Returns the value (right element). |
int |
hashCode()
Returns a hash code value for the pair. |
void |
readFields(DataInput in)
Deserializes this pair. |
void |
set(float left,
int right)
Sets the right and left elements of this pair. |
String |
toString()
Generates human-readable String representation of this pair. |
void |
write(DataOutput out)
Serializes this pair. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PairOfFloatInt()
public PairOfFloatInt(float left,
int right)
left - the left elementright - the right element| Method Detail |
|---|
public void readFields(DataInput in)
throws IOException
readFields in interface Writablein - source for raw byte representation
IOException
public void write(DataOutput out)
throws IOException
write in interface Writableout - where to write the raw byte representation
IOExceptionpublic float getLeftElement()
public int getRightElement()
public float getKey()
public int getValue()
public void set(float left,
int right)
left - the left elementright - the right elementpublic boolean equals(Object obj)
equals in class Objectobj - object for comparison
true if obj is equal to this object, false otherwisepublic int compareTo(PairOfFloatInt obj)
compareTo in interface Comparable<PairOfFloatInt>obj.public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic PairOfFloatInt clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||