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. package com.sun.corba.se.impl.ior.iiop;
  8. import org.omg.IOP.TAG_ORB_TYPE ;
  9. import com.sun.corba.se.spi.ior.TaggedComponentBase ;
  10. import com.sun.corba.se.spi.ior.iiop.ORBTypeComponent ;
  11. import org.omg.CORBA_2_3.portable.OutputStream ;
  12. /**
  13. * @author Ken Cavanaugh
  14. */
  15. public class ORBTypeComponentImpl extends TaggedComponentBase
  16. implements ORBTypeComponent
  17. {
  18. private int ORBType;
  19. public boolean equals( Object obj )
  20. {
  21. if (!(obj instanceof ORBTypeComponentImpl))
  22. return false ;
  23. ORBTypeComponentImpl other = (ORBTypeComponentImpl)obj ;
  24. return ORBType == other.ORBType ;
  25. }
  26. public int hashCode()
  27. {
  28. return ORBType ;
  29. }
  30. public String toString()
  31. {
  32. return "ORBTypeComponentImpl[ORBType=" + ORBType + "]" ;
  33. }
  34. public ORBTypeComponentImpl(int ORBType)
  35. {
  36. this.ORBType = ORBType ;
  37. }
  38. public int getId()
  39. {
  40. return TAG_ORB_TYPE.value ; // 0 in CORBA 2.3.1 13.6.3
  41. }
  42. public int getORBType()
  43. {
  44. return ORBType ;
  45. }
  46. public void writeContents(OutputStream os)
  47. {
  48. os.write_ulong( ORBType ) ;
  49. }
  50. }