1 7 package com.sun.corba.se.spi.orb ; 8 9 public class StringPair { 10 private String first ; 11 private String second ; 12 13 public boolean equals( Object 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 first, String second ) 33 { 34 this.first = first ; 35 this.second = second ; 36 } 37 38 public String getFirst() 39 { 40 return first ; 41 } 42 43 public String getSecond() 44 { 45 return second ; 46 } 47 } 48 49 | Popular Tags |