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 2017/10/03 19:07:32 UTC
svn commit: r1811024 - in /uima/uv3/uimaj-v3/trunk:
uima-docbook-v3-users-guide/src/docbook/uv3.new_extended_apis.xml
uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
Author: schor
Date: Tue Oct 3 19:07:31 2017
New Revision: 1811024
URL: http://svn.apache.org/viewvc?rev=1811024&view=rev
Log:
no Jira add missing convenience method for getAllIndexedFS to CAS interface
Modified:
uima/uv3/uimaj-v3/trunk/uima-docbook-v3-users-guide/src/docbook/uv3.new_extended_apis.xml
uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
Modified: uima/uv3/uimaj-v3/trunk/uima-docbook-v3-users-guide/src/docbook/uv3.new_extended_apis.xml
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uima-docbook-v3-users-guide/src/docbook/uv3.new_extended_apis.xml?rev=1811024&r1=1811023&r2=1811024&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uima-docbook-v3-users-guide/src/docbook/uv3.new_extended_apis.xml (original)
+++ uima/uv3/uimaj-v3/trunk/uima-docbook-v3-users-guide/src/docbook/uv3.new_extended_apis.xml Tue Oct 3 19:07:31 2017
@@ -299,6 +299,8 @@ public final static String _FeatName_sof
<section id="uv3.new_extended_apis.other">
<title>Other changes</title>
+ <para>The convenience methods in the JCas have been duplicated in the CAS, including <code>getAllIndexFS</code>.</para>
+
<para>FSIterator interface now implements Iterable, so you can use these in the extended for syntax.
For example: <code>for (TOP item : jcas.getAllIndexedFSs(TOP.class)) ... </code></para>
Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java?rev=1811024&r1=1811023&r2=1811024&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java (original)
+++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java Tue Oct 3 19:07:31 2017
@@ -1297,4 +1297,19 @@ public interface CAS extends AbstractCas
return this.getJCasImpl().getCasType(clazz);
}
+ /**
+ * Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its
+ * subtypes). The elements are returned in arbitrary order, and duplicates (if they exist)
+ * are not removed.
+ *
+ * @param clazz - the JCas Java class specifing which type and subtypes are included
+ * @param <T> the Java clazz
+ *
+ * @return An iterator that returns all indexed FeatureStructures of the Type and its subtypes,
+ * corresponding to the JCas clazz, in no particular order.
+ */
+ default <T extends TOP> FSIterator<T> getAllIndexedFS(Class<T> clazz) {
+ return this.getIndexRepository().getAllIndexedFS(getCasType(clazz));
+ }
+
}