1 20 package org.apache.mina.util; 21 22 import java.net.SocketAddress ; 23 24 30 public class AnonymousSocketAddress extends SocketAddress implements Comparable { 31 private static final long serialVersionUID = 3978421416766944048L; 32 33 36 public AnonymousSocketAddress() { 37 } 38 39 public int hashCode() { 40 return System.identityHashCode(this); 41 } 42 43 public boolean equals(Object o) { 44 return this == o; 45 } 46 47 public int compareTo(Object o) { 48 return this.hashCode() - ((AnonymousSocketAddress) o).hashCode(); 49 } 50 51 public String toString() { 52 return "anonymous(" + hashCode() + ')'; 53 } 54 } | Popular Tags |