You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/12/15 20:52:15 UTC

svn commit: r1774521 - /uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Author: schor
Date: Thu Dec 15 20:52:14 2016
New Revision: 1774521

URL: http://svn.apache.org/viewvc?rev=1774521&view=rev
Log:
[UIMA-5207] ref doc mention of new capabilities for fsarray, list, stringarray list, etc.

Modified:
    uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Modified: uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml?rev=1774521&r1=1774520&r2=1774521&view=diff
==============================================================================
--- uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml (original)
+++ uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml Thu Dec 15 20:52:14 2016
@@ -364,6 +364,27 @@ under the License.
       particular value for that part of the list. The tail refers to the next list object
       (either a non-empty one or the empty version to indicate the end of the list).</para>
     
+    <para>For JCas users, the new operator for the NonEmptyXXX classes includes a 3 argument version
+    where you may specify the head and tail values as part of the constructor.  The JCas classes implement
+    a <code>push(item)</code> method which creates a new non-empty node, sets the <code>head</code> value
+    to <code>item</code>, and the tail to the node it is called on, and returns the new node.
+    Also, the
+    StringList and FSList implement Iterable, so you can use the enhanced Java <code>for</code> operator.
+    The iterator stops when it gets to the end of the list, determined by either the tail being null or 
+    the element being one of the EmptyXXXList elements.
+    Here's a StringList example:
+    <programlisting>StringList sl = new EmptyStringList(jcas);
+sl = sl.push("2");
+sl = sl.push("1");
+
+for (String s : sl) {
+  someMethod(s);  // some sample use
+}
+// also works with arrays
+</programlisting>
+    
+    </para>
+    
     <para>There are no other built-in types. Users are free to define their own type systems,
       building upon these types.</para>