1 46 package org.mr.core.groups; 47 48 54 public class GroupKey { 55 private String groupIP; 57 private int groupPort; 59 60 public GroupKey(String groupIP ,int groupPort ){ 61 this.groupIP = groupIP; 62 this.groupPort = groupPort; 63 } 64 65 68 public String getGroupIP() { 69 return groupIP; 70 } 71 74 public int getGroupPort() { 75 return groupPort; 76 } 77 78 public int hashCode(){ 79 return groupIP.hashCode()+groupPort; 80 } 81 public boolean equals(Object obj) { 82 if(obj instanceof GroupKey){ 83 return ((GroupKey)obj).groupIP.equals(this.groupIP) && ((GroupKey)obj).groupPort == this.groupPort; 84 }else{ 85 return false; 86 } 87 } 88 } 89 | Popular Tags |