1 /*2 * @(#)MaxStreamFormatVersionComponentImpl.java 1.10 04/06/213 * 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/2110 */11 package com.sun.corba.se.impl.ior.iiop;12 13 import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT ;14 15 import org.omg.CORBA_2_3.portable.OutputStream ;16 17 import javax.rmi.CORBA.Util ;18 import javax.rmi.CORBA.ValueHandler ;19 import javax.rmi.CORBA.ValueHandlerMultiFormat ;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.1128 // TAG_RMI_CUSTOM_MAX_STREAM_FORMAT29 public class MaxStreamFormatVersionComponentImpl extends TaggedComponentBase 30 implements MaxStreamFormatVersionComponent31 {32 private byte version;33 34 public static final MaxStreamFormatVersionComponentImpl singleton35 = new MaxStreamFormatVersionComponentImpl();36 37 public boolean equals(Object 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 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 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