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

📄 arraytype.html

📁 j2ee的API 1.4版本,j2ee的帮助文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
          throws <A HREF="../../../javax/management/openmbean/OpenDataException.html" title="class in javax.management.openmbean">OpenDataException</A></PRE><DL><DD>Constructs an <tt>ArrayType</tt> instance describing <i>open data</i> values which are  arrays with dimension <var>dimension</var> of elements whose <i>open type</i> is <var>elementType</var>. <p> When invoked on an <tt>ArrayType</tt> instance, the <A HREF="../../../javax/management/openmbean/OpenType.html#getClassName()"><CODE>getClassName</CODE></A> method returns the class name of the array instances it describes (following the rules defined by the  <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html#getName()"> <code>getName</code></a> method of <code>java.lang.Class</code>), not the class name of the array elements (which is returned by a call to <tt>getElementOpenType().getClassName()</tt>). <p> The internal field corresponding to the type name of this <code>ArrayType</code> instance is also set to the class name of the array instances it describes.  In other words, the methods <code>getClassName</code> and <code>getTypeName</code> return the same string value. The internal field corresponding to the description of this <code>ArrayType</code> instance is set to a string value which follows the following template:<br> <tt><i>&lt;dimension&gt;</i>-dimension array of <i>&lt;element_class_name&gt;</i></tt> <p> As an example, the following piece of code: <pre> ArrayType t = new ArrayType(3, SimpleType.STRING); System.out.println("array class name       = "+ t.getClassName()); System.out.println("element class name     = "+ t.getElementOpenType().getClassName()); System.out.println("array type name        = "+ t.getTypeName()); System.out.println("array type description = "+ t.getDescription()); </pre> would produce the following output: <pre> array class name       = [[[java.lang.String; element class name     = java.lang.String array type name        = [[[java.lang.String; array type description = 3-dimension array of java.lang.String </pre><P><DT><B>Parameters:</B><DD><CODE>dimension</CODE> - the dimension of arrays described by this <tt>ArrayType</tt> instance;			  must be greater than or equal to 1.<DD><CODE>elementType</CODE> - the <i>open type</i> of element values contained in the arrays described by			    this <tt>ArrayType</tt> instance; must be an instance of either			    <tt>SimpleType</tt>, <tt>CompositeType</tt> or <tt>TabularType</tt>.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <var>dimension</var> is not a positive integer<DD><CODE><A HREF="../../../javax/management/openmbean/OpenDataException.html" title="class in javax.management.openmbean">OpenDataException</A></CODE> - if <var>elementType</var> is an instance of <tt>ArrayType</tt></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getDimension()"><!-- --></A><H3>getDimension</H3><PRE>public int <B>getDimension</B>()</PRE><DL><DD>Returns the dimension of arrays described by this <tt>ArrayType</tt> instance.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the dimension.</DL></DD></DL><HR><A NAME="getElementOpenType()"><!-- --></A><H3>getElementOpenType</H3><PRE>public <A HREF="../../../javax/management/openmbean/OpenType.html" title="class in javax.management.openmbean">OpenType</A> <B>getElementOpenType</B>()</PRE><DL><DD>Returns the <i>open type</i> of element values contained in the arrays described by this <tt>ArrayType</tt> instance.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the element type.</DL></DD></DL><HR><A NAME="isValue(java.lang.Object)"><!-- --></A><H3>isValue</H3><PRE>public boolean <B>isValue</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)</PRE><DL><DD>Tests whether <var>obj</var> is a value for this <code>ArrayType</code> instance. <p> This method returns <code>true</code> if and only if <var>obj</var> is not null, <var>obj</var> is an array and any one of the following is <tt>true</tt>: <p><ul> <li>if this <code>ArrayType</code> instance describes an array of <tt>SimpleType</tt> elements, <var>obj</var>'s class name is the same as the className field defined for this <code>ArrayType</code> instance (ie the class name returned by the <A HREF="../../../javax/management/openmbean/OpenType.html#getClassName()"><CODE>getClassName</CODE></A> method,   which includes the dimension information),<br>&nbsp; </li> <li>if this <code>ArrayType</code> instance describes an array  of classes implementing the TabularData interface or the CompositeData interface,  <var>obj</var> is assignable to such a declared array, and each element contained in <var>obj</var> is either null or a valid value for the element's open type specified by this <code>ArrayType</code> instance. </li></ul> <p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/openmbean/OpenType.html#isValue(java.lang.Object)">isValue</A></CODE> in class <CODE><A HREF="../../../javax/management/openmbean/OpenType.html" title="class in javax.management.openmbean">OpenType</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object to be tested.<DT><B>Returns:</B><DD><code>true</code> if <var>obj</var> is a value for this <code>ArrayType</code> instance.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;obj)</PRE><DL><DD>Compares the specified <code>obj</code> parameter with this <code>ArrayType</code> instance for equality. <p>  Two <code>ArrayType</code> instances are equal if and only if they describes array instances which have the same dimension and elements' open type.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/openmbean/OpenType.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../../javax/management/openmbean/OpenType.html" title="class in javax.management.openmbean">OpenType</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the object to be compared for equality with this <code>ArrayType</code> instance;		    if <var>obj</var> is <code>null</code> or is not an instance of the class <code>ArrayType</code>,               <code>equals</code> returns <code>false</code>.<DT><B>Returns:</B><DD><code>true</code> if the specified object is equal to this <code>ArrayType</code> instance.</DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Returns the hash code value for this <code>ArrayType</code> instance. <p> The hash code of a <code>ArrayType</code> instance is the sum of the hash codes of all elements of information used in <code>equals</code> comparisons  (ie: dimension and elements' type).  This ensures that <code> t1.equals(t2) </code> implies that <code> t1.hashCode()==t2.hashCode() </code>  for any two <code>ArrayType</code> instances <code>t1</code> and <code>t2</code>,  as required by the general contract of the method <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()">  <code>Object.hashCode</code> </a>. <p> As <code>ArrayType</code> instances are immutable, the hash code for this instance is calculated once, on the first call to <code>hashCode</code>, and then the same value is returned for subsequent calls.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/openmbean/OpenType.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../../javax/management/openmbean/OpenType.html" title="class in javax.management.openmbean">OpenType</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the hash code value for this <code>ArrayType</code> instance</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string representation of this <code>ArrayType</code> instance. <p> The string representation consists of  the name of this class (ie <code>javax.management.openmbean.ArrayType</code>), the type name, the dimension and elements' type defined for this instance,  <p> As <code>ArrayType</code> instances are immutable, the string representation for this instance is calculated once, on the first call to <code>toString</code>, and then the same value is returned for subsequent calls.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/management/openmbean/OpenType.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../javax/management/openmbean/OpenType.html" title="class in javax.management.openmbean">OpenType</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this <code>ArrayType</code> instance</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <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="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-all.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> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../../../javax/management/openmbean/CompositeDataSupport.html" title="class in javax.management.openmbean"><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="ArrayType.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.management.openmbean.OpenType">FIELD</A>&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><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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