📄 arraylogic.html
字号:
a transaction is in progress. Thus, this method is suitable for use only when the contents of the array can be left in a partially filled state in the event of a power loss in the middle of the fill operation. <p> The following code snippet shows how this method is typically used: <pre> public short[] myArray = new short[10]; .. // Fill the entire array myArray of 10 short components with the value 0x1234 myArray[0] = (short)0x1234; ArrayLogic.arrayFillGenericNonAtomic(myArray, (short)0, (short)10, myArray, (short)0); .. </pre><p> Note:<ul> <li><em>If </em><code>off</code><em> or </em><code>len</code><em> or </em><code>valOff</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>off+len</code><em> is greater than </em><code>theArray.length</code><em>, the length of the </em><code>theArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>valOff</code><em> is equal to or greater than </em><code>valArray.length</code><em>, the length of the </em><code>valArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>theArray</code><em> or </em><code>valArray</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> <li><em>If power is lost during the copy operation and the array is persistent, a partially changed array could result.</em> <li><em>The </em><code>len</code><em> parameter is not constrained by the atomic commit capacity limitations.</em></ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>theArray</CODE> - the array object<DD><CODE>off</CODE> - offset within array to start filling the specified value<DD><CODE>len</CODE> - the number of component values to be filled<DD><CODE>valArray</CODE> - the array object containing the fill value<DD><CODE>valOff</CODE> - the offset within the <code>valArray</code> array containing the fill value<DT><B>Returns:</B><DD><code>off+len</code><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if the fill operation would cause access of data outside array bounds<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if theArray or valArray is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></CODE> - with the following reason codes:<ul> <li><code>UtilException.ILLEGAL_VALUE</code> if <code>theArray</code> or <code>valArray</code> is not an array of primitive components <li><code>UtilException.TYPE_MISMATCHED</code> if the <code>valArray</code> parameter is not an array of the same primitive component type as the <code>theArray</code>. </ul></DL></DD></DL><HR><A NAME="arrayCompareGeneric(java.lang.Object, short, java.lang.Object, short, short)"><!-- --></A><H3>arrayCompareGeneric</H3><PRE>public static final byte <B>arrayCompareGeneric</B>(<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> src, short srcOff, <A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> dest, short destOff, short length) throws <A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A>, <A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></PRE><DL><DD>Compares an array from the specified source array, beginning at the specified position, with the specified position of the destination array from left to right. Note that this method may be used to compare any two arrays of the same primitive component type - byte, short or int. Returns the ternary result of the comparison : less than(-1), equal(0) or greater than(1). <p>Note:<ul> <li><em>If </em><code>srcOff</code><em> or </em><code>destOff</code><em> or </em><code>length</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>srcOff+length</code><em> is greater than </em><code>src.length</code><em>, the length of the </em><code>src</code><em> array a </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>destOff+length</code><em> is greater than </em><code>dest.length</code><em>, the length of the </em><code>dest</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>src</code><em> or </em><code>dest</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>src</CODE> - source array object<DD><CODE>srcOff</CODE> - offset within source array to start compare<DD><CODE>dest</CODE> - destination array object<DD><CODE>destOff</CODE> - offset within destination array to start compare<DD><CODE>length</CODE> - length to be compared<DT><B>Returns:</B><DD>the result of the comparison as follows:<ul> <li> <code>0</code> if identical</li> <li> <code>-1</code> if the first miscomparing primitive component in source array is less than that in destination array</li> <li> <code>1</code> if the first miscomparing primitive component in source array is greater than that in destination array</li> </ul><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if comparing all the components would cause access of data outside array bounds<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if either <code>src</code> or <code>dest</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></CODE> - with the following reason codes:<ul> <li><code>UtilException.ILLEGAL_VALUE</code> if <code>src</code> or <code>dest</code> is not an array of primitive components, or if the <code>length</code> parameter is incorrect <li><code>UtilException.TYPE_MISMATCHED</code> if the <code>dest</code> parameter is not an array of the same primitive component type. </ul></DL></DD></DL><HR><A NAME="arrayFindGeneric(java.lang.Object, short, byte[], short)"><!-- --></A><H3>arrayFindGeneric</H3><PRE>public static final short <B>arrayFindGeneric</B>(<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A> theArray, short off, byte[] valArray, short valOff) throws <A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A>, <A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A>, <A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></PRE><DL><DD>Finds the first occurrence of the specified value within the specified array. The search begins at the specified position and proceeds until the end of the array. Note that this method may be used to search an array of any primitive component type - byte, short or int. The value used in the search operation is itself specified by the appropriate number of consecutive bytes at offset <code>valOff</code> in the byte array parameter <code>valArray</code>. <p> Note:<ul> <li><em>If </em><code>off</code><em> or </em><code>valOff</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>off</code><em> is greater than </em><code>theArray.length</code><em>, the length of the </em><code>theArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>theArray</code><em> or </em><code>valArray</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em> <li><em>If the specified array is an array of byte components, then the byte at <code>valOff</code> in the <code>valArray</code> is used as the search value. If </em><code>valOff+1</code><em> is greater than </em><code>valArray.length</code><em>, the length of the </em><code>valArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If the specified array is an array of short components, then 2 consecutive bytes beginning at <code>valOff</code> in the <code>valArray</code> are concatenated (high order byte component first) to form the search value. If </em><code>valOff+2</code><em> is greater than </em><code>valArray.length</code><em>, the length of the </em><code>valArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If the specified array is an array of int components, then 4 consecutive bytes beginning at <code>valOff</code> in the <code>valArray</code> are concatenated (high order byte component first) to form the search value. If </em><code>valOff+4</code><em> is greater than </em><code>valArray.length</code><em>, the length of the </em><code>valArray</code><em> array an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>theArray</CODE> - the array object to search<DD><CODE>off</CODE> - offset within the array to start serching for the specified value<DD><CODE>valArray</CODE> - the array object containing the search value<DD><CODE>valOff</CODE> - the offset within the <code>valArray</code> array containing the search value<DT><B>Returns:</B><DD>the offset into the specified array where the first occurrence of specified value was found or -1 if the specified value does not occur in the specified portion of the array<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if the search operation would cause access of data outside array bounds<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>theArray</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util">UtilException</A></CODE> - with the following reason code:<ul> <li><code>UtilException.ILLEGAL_VALUE</code> if <code>theArray</code> is not an array of primitive components</code>. </ul></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=2 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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ArrayLogic.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../javacardx/framework/util/UtilException.html" title="class in javacardx.framework.util"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javacardx/framework/util/ArrayLogic.html" target="_top"><B>FRAMES</B></A> <A HREF="ArrayLogic.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 1993-2005 Sun Microsystems, Inc. 4150 Network Circle,<br>Santa Clara, CA, 95054, U.S.A. All Rights Reserved.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -