KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > orb > StringPair


1 /*
2  * @(#)StringPair.java 1.6 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package com.sun.corba.se.spi.orb ;
8
9 public class StringPair {
10     private String JavaDoc first ;
11     private String JavaDoc second ;
12
13     public boolean equals( Object JavaDoc obj )
14     {
15     if (this == obj)
16         return true ;
17
18     if (!(obj instanceof StringPair))
19         return false ;
20
21     StringPair other = (StringPair)obj ;
22
23     return (first.equals( other.first ) &&
24         second.equals( other.second )) ;
25     }
26
27     public int hashCode()
28     {
29     return first.hashCode() ^ second.hashCode() ;
30     }
31
32     public StringPair( String JavaDoc first, String JavaDoc second )
33     {
34     this.first = first ;
35     this.second = second ;
36     }
37
38     public String JavaDoc getFirst()
39     {
40     return first ;
41     }
42
43     public String JavaDoc getSecond()
44     {
45     return second ;
46     }
47 }
48
49
Popular Tags