KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > ior > iiop > ORBTypeComponentImpl


1 /*
2  * @(#)ORBTypeComponentImpl.java 1.20 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.ior.iiop;
9
10 import org.omg.IOP.TAG_ORB_TYPE JavaDoc ;
11
12 import com.sun.corba.se.spi.ior.TaggedComponentBase ;
13
14 import com.sun.corba.se.spi.ior.iiop.ORBTypeComponent ;
15
16 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
17
18 /**
19  * @author Ken Cavanaugh
20  */

21 public class ORBTypeComponentImpl extends TaggedComponentBase
22     implements ORBTypeComponent
23 {
24     private int ORBType;
25    
26     public boolean equals( Object JavaDoc obj )
27     {
28     if (!(obj instanceof ORBTypeComponentImpl))
29         return false ;
30
31     ORBTypeComponentImpl other = (ORBTypeComponentImpl)obj ;
32
33     return ORBType == other.ORBType ;
34     }
35
36     public int hashCode()
37     {
38     return ORBType ;
39     }
40
41     public String JavaDoc toString()
42     {
43     return "ORBTypeComponentImpl[ORBType=" + ORBType + "]" ;
44     }
45
46     public ORBTypeComponentImpl(int ORBType)
47     {
48     this.ORBType = ORBType ;
49     }
50     
51     public int getId()
52     {
53     return TAG_ORB_TYPE.value ; // 0 in CORBA 2.3.1 13.6.3
54
}
55     
56     public int getORBType()
57     {
58     return ORBType ;
59     }
60     
61     public void writeContents(OutputStream JavaDoc os)
62     {
63     os.write_ulong( ORBType ) ;
64     }
65 }
66
Popular Tags