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/07/20 14:00:50 UTC
svn commit: r1802487 -
/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java
Author: schor
Date: Thu Jul 20 14:00:50 2017
New Revision: 1802487
URL: http://svn.apache.org/viewvc?rev=1802487&view=rev
Log:
[UIMA-5505] support class argument for getAllIndexedFSs
Modified:
uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java
Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java?rev=1802487&r1=1802486&r2=1802487&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java (original)
+++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java Thu Jul 20 14:00:50 2017
@@ -162,4 +162,20 @@ public interface FSIndexRepository {
*/
<T extends FeatureStructure> FSIterator<T> getAllIndexedFS(Type aType);
+ /**
+ * Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its
+ * subtypes). The elements are returned in arbitrary order.
+ *
+ * Generics: T is the Java class for aType.
+ * @param clazz
+ * The JCas class corresponding to the type
+ * @param <T> The Java class associated with aType
+ * @return An iterator that returns all indexed FeatureStructures of the specified type
+ * and its subtypes, in no particular order.
+ */
+ default <T extends FeatureStructure> FSIterator<T> getAllIndexedFS(Class<T> clazz) {
+ return getAllIndexedFS(((FSIndexRepositoryImpl)this).getCasImpl().getJCasImpl().getCasType(clazz));
+ }
+
+
}