value.html

来自「维信SDK文档。源码要求为至少5个C或Java源码」· HTML 代码 · 共 672 行 · 第 1/2 页

HTML
672
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_11) on Tue Oct 23 19:38:42 EEST 2007 --><TITLE>Value (Widsets API)</TITLE><META NAME="keywords" CONTENT="Value class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Value (Widsets API)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../widsets/api/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></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../widsets/api/TimeZone.html" title="class in "><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../widsets/api/View.html" title="class in "><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?widsets/api/Value.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Value.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;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1"></FONT><BR>Class Value</H2><PRE>  <IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../widsets/api/Object.html" title="class in ">Object</A>      <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>Value</B></PRE><HR><DL><DT><PRE>       class <B>Value</B><DT>extends <A HREF="../../widsets/api/Object.html" title="class in ">Object</A></DL></PRE><P><p>Value is a general composite type. It is used when storing data into storage or communicating  with the server side. </p> <p> It can contain following types: <ul> <li><A HREF="../../widsets/api/API.html#IS_NULL"><CODE>IS_NULL</CODE></A>: <code>null</code>, created with <A HREF="../../widsets/api/API.html#NULL()"><CODE>NULL()</CODE></A> <li><A HREF="../../widsets/api/API.html#IS_BOOLEAN"><CODE>IS_BOOLEAN</CODE></A>: <code>boolean</code>  <li><A HREF="../../widsets/api/API.html#IS_INT"><CODE>IS_INT</CODE></A>: <code>int</code>  <li><A HREF="../../widsets/api/API.html#IS_INT"><CODE>IS_INT</CODE></A>: <code>long</code>  <li><A HREF="../../widsets/api/API.html#IS_STRING"><CODE>IS_STRING</CODE></A>: <A HREF="../../widsets/api/String.html" title="class in "><CODE>String</CODE></A>  <li><A HREF="../../widsets/api/API.html#IS_BINARY"><CODE>IS_BINARY</CODE></A>: <A HREF="../../widsets/api/ByteArray.html" title="class in "><CODE>ByteArray</CODE></A>  <li><A HREF="../../widsets/api/API.html#IS_BINDING"><CODE>IS_BINDING</CODE></A>: <code>Value</code>-to-<code>Value</code> binding <li><A HREF="../../widsets/api/API.html#IS_LIST"><CODE>IS_LIST</CODE></A>: list of <code>Values</code> </ul>  </p> <p> There are a number of cast operators that convert between Value and other types.<br><pre>  Value &lt;-&gt; boolean  Value &lt;-&gt; int  Value &lt;-&gt; long  Value &lt;-&gt; String  Value &lt;-&nbsp; List  Value &lt;-&gt; ByteArray</pre> </p> <p> Value list is the native array format (<A HREF="../../widsets/api/API.html#operator_array()"><CODE>operator_array()</CODE></A>):<pre>   Value list = [];    list.add("foo");  list.add("bar");</pre> </p> <p>Value supports inline appending when     being constructed (<A HREF="../../widsets/api/Value.html#operator_append(Value)"><CODE>operator_append(Value)</CODE></A>):<pre>   Value list = ["foo", "bar"];    Value list2 = ["foo", ["bar", "baz"]];  </pre> </p> <p><code>IS_BINDING</code> can be created with arrow expression      (<A HREF="../../widsets/api/API.html#operator_bind(Value, Value)"><CODE>operator_bind(Value, Value)</CODE></A>):<pre>   Value tel = "tel"=>"555-HELIUM";  Value person = ["age"=&gt;25,                  "name=&gt;"john"];    person.add(tel);</pre> </p><P><P><DL><DT><B>See Also:</B><DD><A HREF="../../widsets/api/API.html#operator_array()"><CODE>operator_array()</CODE></A>, <A HREF="../../widsets/api/API.html#operator_bind(Value, Value)"><CODE>operator_bind(Value, Value)</CODE></A>, <A HREF="../../widsets/api/Value.html#operator_append(Value)"><CODE>operator_append(Value)</CODE></A>, <A HREF="../../widsets/api/API.html#call(Object, String, String, Value)"><CODE>call(Object, String, String, Value)</CODE></A>, <A HREF="../../widsets/api/Script.html#onSuccess(Object, Value)"><CODE>Script.onSuccess(Object, Value)</CODE></A>, <A HREF="../../widsets/api/Script.html#onFailure(Object, String)"><CODE>Script.onFailure(Object, String)</CODE></A>, <A HREF="../../widsets/api/SuccessCallback.html" title="interface in "><CODE>SuccessCallback</CODE></A>, <A HREF="../../widsets/api/FailureCallback.html" title="interface in "><CODE>FailureCallback</CODE></A>, <A HREF="../../widsets/api/Store.html" title="class in "><CODE>Store</CODE></A></DL><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#add(Value)">add</A></B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a new element to this Value.</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="../../widsets/api/Value.html#contains(String)">contains</A></B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if any of the child elements with type <code>IS_BINDING</code> has a matching key.</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="../../widsets/api/Value.html#contains(Value)">contains</A></B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if any of the child elements matches given Value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#copy()">copy</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns duplicate of this Value.</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="../../widsets/api/Value.html#isNull()">isNull</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if this Value is <code>IS_NULL</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_append(Value)">operator_append</A></B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;element)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Array append support, see class description.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_get(int)">operator_get</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an element at specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_get(String)">operator_get</A></B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns right side of <code>IS_BINDING</code>  that has a key that matches given argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_get(Value)">operator_get</A></B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;key)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns right side of <code>IS_BINDING</code>  that has a key matching given argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_set(int, Value)">operator_set</A></B>(int&nbsp;index,             <A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets element at specified index.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_set(String, Value)">operator_set</A></B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A>&nbsp;key,             <A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets right side of <code>IS_BINDING</code>  that has a key matching given argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#operator_set(Value, Value)">operator_set</A></B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;key,             <A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets right side of <code>IS_BINDING</code>  that has a key matching given argument.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#remove(int)">remove</A></B>(int&nbsp;index)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes an element at specified index from this Value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../widsets/api/Value.html" title="class in ">Value</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#remove(Value)">remove</A></B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes an element from this Value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#size()">size</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the size of elements in this Value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../widsets/api/Value.html#type()">type</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the type of Value.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class <A HREF="../../widsets/api/Object.html" title="class in ">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../widsets/api/Object.html#toString()">toString</A>, <A HREF="../../widsets/api/Object.html#equals(Object)">equals</A>, <A HREF="../../widsets/api/Object.html#hashCode()">hashCode</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from </B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>equals, getClass, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR>

⌨️ 快捷键说明

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