1 | /* |
2 | * @(#) $Id: AnonymousVmPipeAddress.java 357871 2005-12-20 01:56:40Z 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 The Apache Directory Project (dev@directory.apache.org) |
12 | * @version $Rev: 357871 $, $Date: 2005-12-20 10:56:40 +0900 (Tue, 20 Dec 2005) $ |
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 | } |