⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typecode.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:43:21 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class  TypeCode</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/TypeCode.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../org/omg/CORBA/TCKind.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../org/omg/CORBA/TypeCodeHolder.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="TypeCode.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.omg.CORBA</FONT><BR>Class  TypeCode</H2><PRE><A HREF="../../../java/lang/Object.html">java.lang.Object</A>  |  +--<B>org.omg.CORBA.TypeCode</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../org/omg/CORBA/portable/IDLEntity.html">IDLEntity</A>, <A HREF="../../../java/io/Serializable.html">Serializable</A></DD></DL><HR><DL><DT>public abstract class <B>TypeCode</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../../org/omg/CORBA/portable/IDLEntity.html">IDLEntity</A></DL><P>A container for information about a specific CORBA data type.<P> <code>TypeCode</code> objects are used: <UL> <LI>in the Dynamic Invocation Interface -- to indicate the types of the actual arguments or the type of the return value.  <BR> <code>NamedValue</code> objects are used to represent arguments and return values.  One of their components is an <code>Any</code> object, which in turn has as one of its components a <code>TypeCode</code> object. <LI>by an Interface Repository to represent the type specifications that are part of many OMG IDL declarations </UL> <P> The representation of a <code>TypeCode</code> object is opaque, but abstractly, a <code>TypeCode</code> object consists of: <UL> <LI>a <code>kind</code> field, which is set to an instance of the class <code>TCKind</code> <LI>zero or more additional fields appropriate for the particular kind. For example, the <code>TypeCode</code> object describing the OMG IDL type <code>1ong</code> has kind <code>TCKind.tk_long</code> and no additional fields. The <code>TypeCode</code> describing OMG IDL type <code>sequence&lt;boolean, 10&gt;</code> has a <code>kind</code> field with the value <code>TCKind.tk_sequence</code> and also fields with the values <code>boolean</code> and <code>10</code> for the type of sequence elements and the length of the sequence. <p> </UL> <code>TypeCode</code> objects can be obtained in various ways: <OL> <LI>from a call to the method <code>Any.insert_X</code>, where X is a basic IDL type.  This method creates a <code>TypeCode</code> object for type X and assigns it to the <code>Any</code> object's <code>type</code> field. <LI>from invocations of methods in the ORB class <P>For example, the following creates a <code>TypeCode</code> object for a <code>string</code> with a maximum of 30 characters: <PRE>   org.omg.CORBA.TypeCode tcString = orb.create_string_tc(30); </PRE> <P> The following creates a <code>TypeCode</code> object for an <code>array</code> of five <code>string</code>s: <PRE>   org.omg.CORBA.TypeCode tcArray = orb.create_array_tc(                                       5, TCKind.tk_string); </PRE> <P> The following creates a <code>TypeCode</code> object for an interface named "Account": <PRE>   org.omg.CORBA.TypeCode tcInterface = orb.create_interface_tc(                                                 "thisId", "Account"); </PRE> <LI>as the return value from the <code>_type</code> method in <code>Holder</code> classes for user-defined IDL types.  These <code>Holder</code> classes are generated by the <code>idltojava</code> compiler. <LI>from a CORBA Interface Repository </OL> <P> Most of the methods in the class <code>TypeCode</code> are accessors, and the information contained in a <code>TypeCode</code> object is specific to a particular type.  Therefore, methods must be invoked only on the kind of type codes to which they apply.  If an accessor method tries to access information from an inappropriate kind of type code, it will throw the exception <code>TypeCodePackage.BadKind</code>.  For example, if the method <code>discriminator_type</code> is called on anything other than a <code>union</code>, it will throw <code>BadKind</code> because only <code>union</code>s have a discriminator. The following list shows which methods apply to which kinds of type codes: <P> These methods may be invoked on all <code>TypeCode</code> kinds: <UL> <LI><code>equal</code> <LI><code>kind</code> </UL> <P> These methods may be invoked on <code>objref</code>, <code>struct</code>, <code>union</code>, <code>enum</code>, <code>alias</code>, <code>exception</code>, <code>value</code>, <code>value_box</code>, <code>native</code>,  and <code>abstract_interface</code>: <UL> <LI><code>id</code> <LI><code>name</code> </UL> <P> These methods may be invoked on <code>struct</code>, <code>union</code>, <code>enum</code>, and <code>exception</code>: <UL> <LI><code>member_count</code> <LI><code>member_name</code> </UL> <P> These methods may be invoked on <code>struct</code>, <code>union</code>, and <code>exception</code>: <UL> <LI><code>member_type(int index)</code> </UL> <P> These methods may be invoked on <code>union</code>: <UL> <LI><code>member_label</code> <LI><code>discriminator_type</code> <LI><code>default_index</code> </UL> <P> These methods may be invoked on <code>string</code>, <code>sequence</code>, and <code>array</code>: <UL> <LI><code>length</code> </UL> <P> These methods may be invoked on <code>alias</code>, <code>sequence</code>, <code>array</code>, and <code>value_box</code>: <UL> <LI><code>content_type</code> </UL> <P> Unlike other CORBA pseudo-objects, <code>TypeCode</code> objects can be passed as general IDL parameters. <p> The methods <code>parameter</code> and <code>param_count</code>, which are deprecated, are not mapped.  <p> Java IDL extends the CORBA specification to allow all operations permitted on a <code>struct</code> <code>TypeCode</code> to be permitted on an <code>exception</code> <code>TypeCode</code> as well. <p><P><DL><DT><B>See Also: </B><DD><A HREF="../../../serialized-form.html#org.omg.CORBA.TypeCode">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#TypeCode()">TypeCode</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../org/omg/CORBA/TypeCode.html">TypeCode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#concrete_base_type()">concrete_base_type</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>TypeCode</code> object that describes the concrete base type of the value type that this <code>TypeCode</code> object describes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="../../../org/omg/CORBA/TypeCode.html">TypeCode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#content_type()">content_type</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>TypeCode</code> object representing the IDL type for the members of the object described by this <code>TypeCode</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#default_index()">default_index</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of the default member, or -1 if there is no default member.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="../../../org/omg/CORBA/TypeCode.html">TypeCode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#discriminator_type()">discriminator_type</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>TypeCode</code> object describing all non-default member labels.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#equal(org.omg.CORBA.TypeCode)">equal</A></B>(<A HREF="../../../org/omg/CORBA/TypeCode.html">TypeCode</A>&nbsp;tc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares this <code>TypeCode</code> object with the given one, testing for equality.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#equivalent(org.omg.CORBA.TypeCode)">equivalent</A></B>(<A HREF="../../../org/omg/CORBA/TypeCode.html">TypeCode</A>&nbsp;tc)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests to see if the given <code>TypeCode</code> object is  equivalent to this <code>TypeCode</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#fixed_digits()">fixed_digits</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of digits in the fixed type described by this <code>TypeCode</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#fixed_scale()">fixed_scale</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the scale of the fixed type described by this  <code>TypeCode</code> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../org/omg/CORBA/TypeCode.html">TypeCode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/omg/CORBA/TypeCode.html#get_compact_typecode()">get_compact_typecode</A></B>()</CODE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -