KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)MaxStreamFormatVersionComponentImpl.java 1.10 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 /**
9  * @(#)MaxStreamFormatVersionComponentImpl.java 1.10 04/06/21
10  */

11 package com.sun.corba.se.impl.ior.iiop;
12
13 import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT JavaDoc;
14
15 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc;
16
17 import javax.rmi.CORBA.Util JavaDoc;
18 import javax.rmi.CORBA.ValueHandler JavaDoc;
19 import javax.rmi.CORBA.ValueHandlerMultiFormat JavaDoc;
20
21 import com.sun.corba.se.impl.orbutil.ORBUtility;
22
23 import com.sun.corba.se.spi.ior.TaggedComponentBase;
24
25 import com.sun.corba.se.spi.ior.iiop.MaxStreamFormatVersionComponent;
26
27 // Java to IDL ptc 02-01-12 1.4.11
28
// TAG_RMI_CUSTOM_MAX_STREAM_FORMAT
29
public class MaxStreamFormatVersionComponentImpl extends TaggedComponentBase
30     implements MaxStreamFormatVersionComponent
31 {
32     private byte version;
33
34     public static final MaxStreamFormatVersionComponentImpl singleton
35         = new MaxStreamFormatVersionComponentImpl();
36
37     public boolean equals(Object JavaDoc obj)
38     {
39     if (!(obj instanceof MaxStreamFormatVersionComponentImpl))
40         return false ;
41
42     MaxStreamFormatVersionComponentImpl other =
43         (MaxStreamFormatVersionComponentImpl)obj ;
44
45     return version == other.version ;
46     }
47
48     public int hashCode()
49     {
50     return version ;
51     }
52
53     public String JavaDoc toString()
54     {
55     return "MaxStreamFormatVersionComponentImpl[version=" + version + "]" ;
56     }
57
58     public MaxStreamFormatVersionComponentImpl()
59     {
60         version = ORBUtility.getMaxStreamFormatVersion();
61     }
62
63     public MaxStreamFormatVersionComponentImpl(byte streamFormatVersion) {
64         version = streamFormatVersion;
65     }
66
67     public byte getMaxStreamFormatVersion()
68     {
69     return version;
70     }
71
72     public void writeContents(OutputStream JavaDoc os)
73     {
74         os.write_octet(version);
75     }
76     
77     public int getId()
78     {
79     return TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value;
80     }
81 }
82
Popular Tags