DynStructOperations.java 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* DynStructOperations.java --
  2. Copyright (C) 2005, 2006 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package org.omg.DynamicAny;
  32. import org.omg.CORBA.TCKind;
  33. import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
  34. import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
  35. /**
  36. * Defines the operations, applicable to the DynStructure.
  37. *
  38. * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
  39. */
  40. public interface DynStructOperations
  41. extends DynAnyOperations
  42. {
  43. /**
  44. * Get the kind of the structure field at the current position.
  45. *
  46. * @return the kind of field.
  47. *
  48. * @throws TypeMismatch for an empty structure (normally exception).
  49. * @throws InvalidValue if the current position does not indicate a memeber.
  50. */
  51. TCKind current_member_kind()
  52. throws TypeMismatch, InvalidValue;
  53. /**
  54. * Get the name of the structure field at the current position.
  55. *
  56. * @return the name of the field.
  57. *
  58. * @throws TypeMismatch for an empty structure (normally exception).
  59. * @throws InvalidValue if the current position does not indicate a memeber.
  60. */
  61. String current_member_name()
  62. throws TypeMismatch, InvalidValue;
  63. /**
  64. * Return array, describing describing the name and the value of each member
  65. * in the structure.
  66. *
  67. * @return an array of NameDynAnyPair's, each defining a single field in this
  68. * structure.
  69. */
  70. NameDynAnyPair[] get_members_as_dyn_any();
  71. /**
  72. * Return array, describing describing the name and the value of each member
  73. * in the structure.
  74. *
  75. * @return an array of NameValuePair's, each defining a single field in this
  76. * structure.
  77. */
  78. NameValuePair[] get_members();
  79. /**
  80. * Set the structure contend from the array, where each member defines the
  81. * name and value of the structure field. If the passed array is not empty,
  82. * the current position is set to the first member.
  83. *
  84. * The members of array must follow in the same order as the structure fields,
  85. * how they are defined in the typecode. The name-based value assignment is
  86. * not supported.
  87. *
  88. * @specnote The name-based value assignment is not supported by Sun's jdk
  89. * 1.4.
  90. *
  91. * @param value an array of NameDynValuePair's, each defining a single field in the
  92. * structure.
  93. *
  94. * @throws TypeMismatch if the member of the passed array has a different type
  95. * than the corresponding structure field.
  96. *
  97. * @throws InvalidValue if the size of the passed array is not the same as the
  98. * number of fields in this structure.
  99. */
  100. void set_members_as_dyn_any(NameDynAnyPair[] value)
  101. throws TypeMismatch, InvalidValue;
  102. /**
  103. * Set the structure contend from the array, where each member defines the
  104. * name and value of the structure field. If the passed array is not empty,
  105. * the current position is set to the first member.
  106. *
  107. * The members of array must follow in the same order as the structure fields,
  108. * how they are defined in the typecode. The name-based value assignment is
  109. * not supported.
  110. *
  111. * @specnote The name-based value assignment is not supported by Sun's jdk
  112. * 1.4.
  113. *
  114. * @param value an array of NameValuePair's, each defining a single field in the
  115. * structure.
  116. *
  117. * @throws TypeMismatch if the member of the passed array has a different type
  118. * than the corresponding structure field.
  119. *
  120. * @throws InvalidValue if the size of the passed array is not the same as the
  121. * number of fields in this structure.
  122. */
  123. void set_members(NameValuePair[] value)
  124. throws TypeMismatch, InvalidValue;
  125. }