1. /*
  2. * @(#)BindingTypeHelper.java 1.6 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * File: ./org/omg/CosNaming/BindingTypeHelper.java
  9. * From: nameservice.idl
  10. * Date: Tue Aug 11 03:12:09 1998
  11. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  12. */
  13. package org.omg.CosNaming;
  14. public class BindingTypeHelper {
  15. // It is useless to have instances of this class
  16. private BindingTypeHelper() { }
  17. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CosNaming.BindingType that) {
  18. out.write_long(that.value());
  19. }
  20. public static org.omg.CosNaming.BindingType read(org.omg.CORBA.portable.InputStream in) {
  21. return org.omg.CosNaming.BindingType.from_int(in.read_long());
  22. }
  23. public static org.omg.CosNaming.BindingType extract(org.omg.CORBA.Any a) {
  24. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  25. return read(in);
  26. }
  27. public static void insert(org.omg.CORBA.Any a, org.omg.CosNaming.BindingType that) {
  28. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  29. write(out, that);
  30. a.read_value(out.create_input_stream(), type());
  31. }
  32. private static org.omg.CORBA.TypeCode _tc;
  33. private static final int _memberCount = 2;
  34. private static String[] _members = {
  35. "nobject",
  36. "ncontext"
  37. };
  38. synchronized public static org.omg.CORBA.TypeCode type() {
  39. if (_tc == null)
  40. _tc = org.omg.CORBA.ORB.init().create_enum_tc(id(), "BindingType", _members);
  41. return _tc;
  42. }
  43. public static String id() {
  44. return "IDL:omg.org/CosNaming/BindingType:1.0";
  45. }
  46. }