1 21 22 package org.opensubsystems.core.util; 23 24 33 public class TwoIntStruct 34 { 35 37 40 protected int m_iFirst; 41 42 45 protected int m_iSecond; 46 47 49 55 public TwoIntStruct(int iFirst, int iSecond) 56 { 57 m_iFirst = iFirst; 58 m_iSecond = iSecond; 59 } 60 61 66 public TwoIntStruct(TwoIntStruct input) 67 { 68 assert input != null : "Can't create empty TwoIntStruct"; 69 70 m_iFirst = input.getFirst(); 71 m_iSecond = input.getSecond(); 72 } 73 74 76 79 public int getFirst() 80 { 81 return m_iFirst; 82 } 83 84 87 public int getSecond() 88 { 89 return m_iSecond; 90 } 91 92 95 public boolean equals( 96 Object oObject 97 ) 98 { 99 boolean bRetval = false; 100 if (oObject == this) 101 { 102 return true; 103 } 104 else if (oObject != null) 105 { 106 if (oObject instanceof TwoIntStruct) 107 { 108 TwoIntStruct input = (TwoIntStruct) oObject; 109 return (m_iFirst == input.m_iFirst) 110 && (m_iSecond == input.m_iSecond); 111 } 112 } 113 return bRetval; 114 } 115 116 119 public int hashCode() 120 { 121 int iResult = HashCodeUtils.SEED; 122 iResult = HashCodeUtils.hash(iResult, m_iFirst); 123 iResult = HashCodeUtils.hash(iResult, m_iSecond); 124 return iResult; 125 } 126 } 127 | Popular Tags |