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 2007/01/11 23:16:07 UTC
svn commit: r495404 - in
/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas:
JFSIndexRepository.java impl/JFSIndexRepositoryImpl.java
Author: schor
Date: Thu Jan 11 14:16:06 2007
New Revision: 495404
URL: http://svn.apache.org/viewvc?view=rev&rev=495404
Log:
UIMA-179 add methods that forward to CAS equivalents
for getAllIndexedFS.
Modified:
incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java
incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java?view=diff&rev=495404&r1=495403&r2=495404
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java Thu Jan 11 14:16:06 2007
@@ -23,6 +23,8 @@
import org.apache.uima.cas.FSIndex;
import org.apache.uima.cas.FSIndexRepository;
+import org.apache.uima.cas.FSIterator;
+import org.apache.uima.cas.Type;
/**
* Provides the same function as the FSIndexRepository except that the variants that take a "type"
@@ -95,5 +97,37 @@
* @return The associated FSIndexRepository.
*/
FSIndexRepository getFSIndexRepository();
+
+ /**
+ * Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its
+ * subtypes).
+ * <p>
+ * Limitation: If there are no sorted or bag indexes defined for this type, but there is more than
+ * one set index defined, then this method will only return the contents of one of these set
+ * indexes (chosen arbitrarily).
+ *
+ * @param aType
+ * The type
+ *
+ * @return An iterator that returns all indexed FeatureStructures of type <code>aType</code>,
+ * in no particular order.
+ */
+ FSIterator getAllIndexedFS(Type aType);
+
+ /**
+ * Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its
+ * subtypes).
+ * <p>
+ * Limitation: If there are no sorted or bag indexes defined for this type, but there is more than
+ * one set index defined, then this method will only return the contents of one of these set
+ * indexes (chosen arbitrarily).
+ *
+ * @param aType
+ * The type obtained by doing MyJCasClass.type
+ *
+ * @return An iterator that returns all indexed FeatureStructures of type <code>aType</code>,
+ * in no particular order.
+ */
+ FSIterator getAllIndexedFS(int aType);
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java?view=diff&rev=495404&r1=495403&r2=495404
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java Thu Jan 11 14:16:06 2007
@@ -25,6 +25,8 @@
import org.apache.uima.cas.CASRuntimeException;
import org.apache.uima.cas.FSIndex;
import org.apache.uima.cas.FSIndexRepository;
+import org.apache.uima.cas.FSIterator;
+import org.apache.uima.cas.Type;
import org.apache.uima.cas.text.TCAS;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JFSIndexRepository;
@@ -118,5 +120,19 @@
*/
public FSIndexRepository getFSIndexRepository() {
return fsIndexRepository;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.jcas.JFSIndexRepository#getAllIndexedFS(org.apache.uima.cas.Type)
+ */
+ public FSIterator getAllIndexedFS(Type aType) {
+ return fsIndexRepository.getAllIndexedFS(aType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.jcas.JFSIndexRepository#getAllIndexedFS(int)
+ */
+ public FSIterator getAllIndexedFS(int aType) {
+ return fsIndexRepository.getAllIndexedFS(jcas.getCasType(aType));
}
}