View Javadoc

1   /*
2    * @(#) $Id: AnonymousVmPipeAddress.java 210062 2005-07-11 03:52:38Z trustin $
3    */
4   package org.apache.mina.protocol.vmpipe;
5   
6   import java.net.SocketAddress;
7   
8   /***
9    * A {@link SocketAddress} which represents anonymous in-VM pipe port.
10   * 
11   * @author Trustin Lee (trustin@apache.org)
12   * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
13   */
14  class AnonymousVmPipeAddress extends SocketAddress implements Comparable
15  {
16      private static final long serialVersionUID = 3258135768999475512L;
17  
18  	static final AnonymousVmPipeAddress INSTANCE = new AnonymousVmPipeAddress();
19  
20      /***
21       * Creates a new instance with the specifid port number.
22       */
23      private AnonymousVmPipeAddress()
24      {
25      }
26  
27      public int hashCode()
28      {
29          return 1432482932;
30      }
31  
32      public boolean equals( Object o )
33      {
34          if( o == null )
35              return false;
36          if( this == o )
37              return true;
38          return o instanceof AnonymousVmPipeAddress;
39      }
40  
41      public int compareTo( Object o )
42      {
43          return this.hashCode() - ( ( AnonymousVmPipeAddress ) o ).hashCode();
44      }
45  
46      public String toString()
47      {
48          return "vm:anonymous";
49      }
50  }