Extension SDK 10.1.2

oracle.ide.util
Class Pair

java.lang.Object
  extended byoracle.ide.util.Pair
All Implemented Interfaces:
java.lang.Comparable

public class Pair
extends java.lang.Object
implements java.lang.Comparable

Encapsulates a Pair of objects.
Note: The toString() method returns the toString() of the first object. This allows for example to easily attach data to a JList object by passing a Pair("Label", myObject).


Field Summary
 java.lang.Object first
           
 java.lang.Object second
           
 
Constructor Summary
Pair()
          Default constructor
Pair(java.lang.Object firstObj, java.lang.Object secondObj)
          Default constructor
Pair(Pair pair)
          Cloning Constructor
 
Method Summary
 int compareTo(java.lang.Object o)
          implements Comparable on the first element only.
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getFirst()
           
 java.lang.Object getSecond()
           
 int hashCode()
           
 void setFirst(java.lang.Object firstObj)
           
 void setSecond(java.lang.Object secondObj)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

first

public java.lang.Object first

second

public java.lang.Object second
Constructor Detail

Pair

public Pair()
Default constructor


Pair

public Pair(java.lang.Object firstObj,
            java.lang.Object secondObj)
Default constructor


Pair

public Pair(Pair pair)
Cloning Constructor

Method Detail

setFirst

public void setFirst(java.lang.Object firstObj)

getFirst

public java.lang.Object getFirst()

setSecond

public void setSecond(java.lang.Object secondObj)

getSecond

public java.lang.Object getSecond()

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()

compareTo

public int compareTo(java.lang.Object o)
implements Comparable on the first element only.

Specified by:
compareTo in interface java.lang.Comparable

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.