Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities
Class IntegerTriple

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.IntegerTriple
All Implemented Interfaces:
Comparable<IntegerTriple>

public class IntegerTriple
extends Object
implements Comparable<IntegerTriple>

Provides a key of three integers. Two IntegerTriple-Objects are equal, if they consist of the same three integers defined in the same order.

Author:
Noemi Andor

Field Summary
private  Integer first
          First integer.
private  Integer last
          Third integer.
private  Integer second
          Second integer.
 
Constructor Summary
IntegerTriple()
          Empty constructor creating an IntegerTriple-Object.
IntegerTriple(int first, int second, int last)
          Constructor which initiates an IntegerTriple Object with three integers.
 
Method Summary
 int compareTo(IntegerTriple o)
          Compares this IntegerTriple with an IntegerTriple o.
 boolean equals(Object obj)
          Verifies if this Object is equals to Object obj.
 int getFirst()
           
 int getLast()
           
 int getSecond()
           
 int hashCode()
          Creates the hashCode dependent on the three integers this Object consist.
 void setFirst(int first)
          Sets the first Argument of this Object.
 void setLast(int last)
          Sets the third Argument of this Object.
 void setSecond(int second)
          Sets the second Argument of this Object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

private Integer first
First integer.


second

private Integer second
Second integer.


last

private Integer last
Third integer.

Constructor Detail

IntegerTriple

public IntegerTriple(int first,
                     int second,
                     int last)
Constructor which initiates an IntegerTriple Object with three integers.

Parameters:
first - first integer-value
second - second integer-value
last - third integer-value

IntegerTriple

public IntegerTriple()
Empty constructor creating an IntegerTriple-Object.

Method Detail

getFirst

public int getFirst()
Returns:
the first integer-value of the IntegerTriple-Object.

getSecond

public int getSecond()
Returns:
the second integer-value of the IntegerTriple-Object.

getLast

public int getLast()
Returns:
the third integer-value of the IntegerTriple-Object.

compareTo

public int compareTo(IntegerTriple o)
Compares this IntegerTriple with an IntegerTriple o. If this Object is greater than the other object, then 1 is returned, else if the two Objects are equal, 0 is returned. If IntegerTriple o is greater then this IntegerTriple, then -1 is returned.

Specified by:
compareTo in interface Comparable<IntegerTriple>

hashCode

public int hashCode()
Creates the hashCode dependent on the three integers this Object consist.

Overrides:
hashCode in class Object
Returns:
the hashCode of this Object

equals

public boolean equals(Object obj)
Verifies if this Object is equals to Object obj.

Overrides:
equals in class Object
Parameters:
obj - object to be compared with this object
Returns:
true if this Object is equals to Object obj, false otherwise

setFirst

public void setFirst(int first)
Sets the first Argument of this Object.

Parameters:
first -

setSecond

public void setSecond(int second)
Sets the second Argument of this Object.

Parameters:
second -

setLast

public void setLast(int last)
Sets the third Argument of this Object.

Parameters:
last -

Release 0.1 (2008-07-10_1838)