1 6 7 package SOFA.SOFAnet.Search; 8 9 import java.io.Serializable ; 10 11 17 public class SearchRequestID implements Serializable 18 { 19 private int requestMark; private String sourceNode; 22 23 public SearchRequestID() 24 { 25 } 26 27 public SearchRequestID(int requestMark, String sourceNode) 28 { 29 this.requestMark = requestMark; 30 this.sourceNode = sourceNode; 31 } 32 33 public int getRequestMark() 34 { 35 return requestMark; 36 } 37 38 public String getSourceNode() 39 { 40 return sourceNode; 41 } 42 43 public void setRequestMark(int requestMark) 44 { 45 this.requestMark = requestMark; 46 } 47 48 public void setSourceNode(String sourceNode) 49 { 50 this.sourceNode = sourceNode; 51 } 52 53 public boolean equals(Object o) 54 { 55 if (this == o) return true; 56 if (o instanceof SearchRequestID) 57 { 58 SearchRequestID anotherSearchRequestID = (SearchRequestID)o; 59 if (requestMark != anotherSearchRequestID.requestMark) return false; 60 if (sourceNode == null) 61 { 62 if (anotherSearchRequestID.sourceNode == null) return true; 63 else return false; 64 } 65 else 66 { 67 if (anotherSearchRequestID.sourceNode == null) return false; 68 return sourceNode.compareTo(anotherSearchRequestID.sourceNode) == 0; 69 } 70 } 71 else return false; 72 } 73 } 74 | Popular Tags |