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

📄 pimitem.html

📁 J2ME PDA开发PIM的技术规范,可使应用程序查看手机本地联系人列表, 本地文件
💻 HTML
📖 第 1 页 / 共 5 页
字号:
					Constant indicating the minimum possible value for an extended attribute 
					constant.
					<P>
						<DL>
							<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javax.microedition.pim.PIMItem.EXTENDED_ATTRIBUTE_MIN_VALUE">Constant 
										Field Values</A></DD></DL>
				</DD>
			</DL>
			<!-- ========= CONSTRUCTOR DETAIL ======== -->
			<!-- ============ METHOD DETAIL ========== -->
			<A NAME="method_detail"><!-- --></A>
			<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
				<TR BGCOLOR="#ccccff" CLASS="TableHeadingColor">
					<TD COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD>
				</TR>
			</TABLE>
			<A NAME="getPIMList()"><!-- --></A><H3>
				getPIMList</H3>
			<PRE>
public <A HREF="../../../javax/microedition/pim/PIMList.html">PIMList</A> <B>getPIMList</B>()</PRE>
			<DL>
				<DD>
					Returns the PIMList associated with this item. An item always have the same 
					list associated with it for its life as an object once a list is associated 
					with the item.
					<P></P>
					<DD>
						<DL>
							<DT><B>Returns:</B><DD>the PIMList that this item belongs to. If the item does not 
									belong to any list, <code>null</code> is returned.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="commit()"><!-- --></A><H3>
				commit</H3>
			<PRE>
public void <B>commit</B>()
            throws <A HREF="../../../javax/microedition/pim/PIMException.html">PIMException</A></PRE>
			<DL>
				<DD>
					This method persists the data in the item to its PIM list. As data is changed 
					in an item through other methods in this class, the data is not immediately 
					written to the underlying data storage for the list. This method commits that 
					data to the underlying data storage for the list.
					<p>
						Some devices may not allow categories in the item to be persisted which are not 
						in the list returned from <A HREF="../../../javax/microedition/pim/PIMList.html#getCategories()">
							<CODE>PIMList.getCategories()</CODE></A>. In this case the categories are 
						dropped silently when this method is invoked (this allows data imported using <A HREF="../../../javax/microedition/pim/PIM.html#fromSerialFormat(java.io.InputStream, java.lang.String)">
							<CODE>PIM.fromSerialFormat(java.io.InputStream, java.lang.String)</CODE></A>
						to be persisted).
					</p>
					<p>
						Also note that some field values may be altered during the commit to fit 
						platform restrictions. A common example of this is Date fields. If a platform 
						does not support storing its Date values with millisecond granularity, the 
						platform rounds down the given Date value to its nearest value supported by the 
						platform.
					</p>
					<P></P>
					<DD>
						<DL>
							<DT><B>Throws:</B>
								<DD>
									<CODE><A HREF="../../../javax/microedition/pim/PIMException.html">PIMException</A></CODE>
									- if the commit encounters an error and cannot complete. Also thrown if the 
									item does not belong to any list, or the list is closed or inaccessible.
									<DD>
										<CODE>java.lang.SecurityException</CODE> - if the application has not been 
										granted write access to the PIM list or the list is opened READ_ONLY.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="isModified()"><!-- --></A><H3>
				isModified</H3>
			<PRE>
public boolean <B>isModified</B>()</PRE>
			<DL>
				<DD>
					This method returns a boolean indicating whether any of this item's fields have 
					been modified since the item was retrieved or last committed.
					<P></P>
					<DD>
						<DL>
							<DT><B>Returns:</B><DD>boolean true if any fields have been modified since the item was 
									last retrieved or committed, false otherwise.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="getFields()"><!-- --></A><H3>
				getFields</H3>
			<PRE>
public int[] <B>getFields</B>()</PRE>
			<DL>
				<DD>
					Returns all fields in the item that have data stored for them. This allows 
					quick access to all of the data stored in the item without having to iterate 
					through all supported fields and checking if data is stored for the field or 
					not.
					<P></P>
					<DD>
						<DL>
							<DT><B>Returns:</B><DD>int array of fields that have data currently stored for them. If 
									no fields contain data, a zero length array is returned.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="getBinary(int, int)"><!-- --></A><H3>
				getBinary</H3>
			<PRE>
public byte[] <B>getBinary</B>(int&nbsp;field,
                        int&nbsp;index)</PRE>
			<DL>
				<DD>
					Get a binary data value for a field from the item. <A HREF="../../../javax/microedition/pim/PIMList.html#isSupportedField(int)">
						<CODE>PIMList.isSupportedField(int)</CODE></A> should be used to verify the 
					field validity for this item prior to invoking this method.
					<P></P>
					<DD>
						<DL>
							<DT><B>Parameters:</B><DD><CODE>field</CODE> - The field from which the data is 
									retrieved.<DD><CODE>index</CODE> - an index to a particular value associated with 
										the field. <DT><B>Returns:</B><DD>a byte array representing a value for the field. The 
												value is an inline binary data representation in a "B" binary encoded string as 
												defined by [IETF RFC 2047]. <DT><B>Throws:</B>
													<DD>
														<CODE>java.lang.IllegalArgumentException</CODE> - if the field is not valid for 
														the implementing class.
														<DD>
															<CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is negative or 
															greater than or equal to the number of values currently contained in the field.
															<DD>
																<CODE><A HREF="../../../javax/microedition/pim/UnsupportedFieldException.html">UnsupportedFieldException</A></CODE>
																- if the field is not supported in the implementing instance of the class.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="addBinary(int, int, byte[], int, int)"><!-- --></A><H3>
				addBinary</H3>
			<PRE>
public void <B>addBinary</B>(int&nbsp;field,
                      int&nbsp;attributes,
                      byte[]&nbsp;value,
                      int&nbsp;offset,
                      int&nbsp;length)</PRE>
			<DL>
				<DD>
					Adds a binary data value to a field in the item. The value is appended as the 
					last data value in the field's array, similar to <code>Vector.addElement</code>.
					<A HREF="../../../javax/microedition/pim/PIMList.html#isSupportedField(int)"><CODE>PIMList.isSupportedField(int)</CODE></A>
					should be used to verify the field validity for this item prior to invoking 
					this method.
					<P></P>
					<DD>
						<DL>
							<DT><B>Parameters:</B><DD><CODE>field</CODE> - The field to which the value belongs.<DD><CODE>attributes</CODE>
										- a bit array specifying any optional attributes describing this value. These 
										attributes are a hint to the about the value's characteristics and some or all 
										may be ignored by this method due to platform restrictions. Attributes that are 
										invalid or not applicable are also ignored.<DD><CODE>value</CODE> - The data to add 
											to the field. The data is an inline binary data representation and must be in a 
											"B" binary encoded string as defined by [IETF RFC 2047].<DD><CODE>offset</CODE> - 
												int indicating the offset into the provided byte array from where to start 
												reading the binary data.<DD><CODE>length</CODE> - int indicating the number of 
													bytes to read from starting from the offset in the byte array. If the number of 
													bytes available from the array are less than the length, only the remaining 
													bytes are provided and the field's resulting binary data length is <code>value.length 
														- offset</code>. <DT><B>Throws:</B>
														<DD>
															<CODE>java.lang.IllegalArgumentException</CODE> - if the field is not valid for 
															the implementing class, the field does not have a data type of <code>BINARY</code>, 
															offset is negative, offset is greater than or equal to the length of the value 
															byte array, length is zero or negative, or the value array is length 0.
															<DD>
																<CODE>java.lang.NullPointerException</CODE> - if <code>value</code> is <code>null</code>.
																<DD>
																	<CODE><A HREF="../../../javax/microedition/pim/UnsupportedFieldException.html">UnsupportedFieldException</A></CODE>
																	- if the field is not supported in the implementing instance of the class.
																	<DD>
																		<CODE><A HREF="../../../javax/microedition/pim/FieldFullException.html">FieldFullException</A></CODE>
																		- if the field already contains the maximum number of data values it can hold.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="setBinary(int, int, int, byte[], int, int)"><!-- --></A><H3>
				setBinary</H3>
			<PRE>
public void <B>setBinary</B>(int&nbsp;field,
                      int&nbsp;index,
                      int&nbsp;attributes,
                      byte[]&nbsp;value,
                      int&nbsp;offset,
                      int&nbsp;length)</PRE>
			<DL>
				<DD>
					Sets an existing binary data value in a field to a new value. The value located 
					at the provided index is set, similar to <code>Vector.setElementAt</code>. This 
					method cannot be used to add new values to a field; use <A HREF="../../../javax/microedition/pim/PIMItem.html#addBinary(int, int, byte[], int, int)">
						<CODE>addBinary(int, int, byte[], int, int)</CODE></A>. <A HREF="../../../javax/microedition/pim/PIMList.html#isSupportedField(int)">
						<CODE>PIMList.isSupportedField(int)</CODE></A> should be used to verify the 
					field validity for this item prior to invoking this method.
					<P></P>
					<DD>
						<DL>
							<DT><B>Parameters:</B><DD><CODE>field</CODE> - The field to which the value belongs.<DD><CODE>index</CODE>
										- an index to a particular value associated with the field.<DD><CODE>attributes</CODE>
											- a bit array specifying any optional attributes describing this value. These 
											attributes are a hint to the about the value's characteristics and some or all 
											may be ignored by this method due to platform restrictions. Attributes that are 
											invalid or not applicable are also ignored.<DD><CODE>value</CODE> - The new value 
												of the data at the field's index. The data is an inline binary data 
												representation and must be in a "B" binary encoded string as defined by [IETF 
												RFC 2047].<DD><CODE>offset</CODE> - int indicating the offset into the provided 
													byte array from where to start reading the binary data.<DD><CODE>length</CODE> - 
														int indicating the number of bytes to read starting from the offset in the byte 
														array. If the number of bytes available from the array are less than the 
														length, only the remaining bytes are provided and the field's resulting binary 
														data length is <code>value.length - offset</code>. <DT><B>Throws:</B>
															<DD>
																<CODE>java.lang.IllegalArgumentException</CODE> - if the field is not valid for 
																the implementing class, if <code>offset</code> is negative, <code>length</code> 
																is less than or equal to zero, or <code>value</code> is zero length.
																<DD>
																	<CODE>java.lang.NullPointerException</CODE> - if <code>value</code> is <code>null</code>.
																	<DD>
																		<CODE><A HREF="../../../javax/microedition/pim/UnsupportedFieldException.html">UnsupportedFieldException</A></CODE>
																		- if the field is not supported in the implementing instance of the class.
																		<DD>
																			<CODE>java.lang.IndexOutOfBoundsException</CODE> - if the index is negative or 
																			greater than or equal to the number of values currently contained in the field.</DD></DL>
					</DD>
			</DL>
			<HR>
			<A NAME="getDate(int, int)"><!-- --></A><H3>
				getDate</H3>
			<PRE>
public long <B>getDate</B>(int&nbsp;field,

⌨️ 快捷键说明

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