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