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/12 17:02:31 UTC
svn commit: r495621 - in
/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas:
JCas.java impl/JCasImpl.java
Author: schor
Date: Fri Jan 12 08:02:30 2007
New Revision: 495621
URL: http://svn.apache.org/viewvc?view=rev&rev=495621
Log:
UIMA-184 Add getAnnotationIndex to JCAS API and Impl.
Modified:
incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java?view=diff&rev=495621&r1=495620&r2=495621
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java Fri Jan 12 08:02:30 2007
@@ -41,6 +41,7 @@
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.LowLevelCAS;
import org.apache.uima.cas.impl.LowLevelIndexRepository;
+import org.apache.uima.cas.text.AnnotationIndex;
import org.apache.uima.jcas.cas.FSArray;
import org.apache.uima.jcas.cas.FloatArray;
import org.apache.uima.jcas.cas.IntegerArray;
@@ -485,5 +486,32 @@
* If the <code>fs</code> parameter is <code>null</code>.
*/
void removeFsFromIndexes(FeatureStructure fs);
+
+ /**
+ * Get the standard annotation index.
+ *
+ * @return The standard annotation index.
+ */
+ AnnotationIndex getAnnotationIndex();
+
+ /**
+ * Get the standard annotation index restricted to a specific annotation type.
+ *
+ * @param type
+ * The annotation type the index is restricted to.
+ * @return The standard annotation index, restricted to <code>type</code>.
+ */
+ AnnotationIndex getAnnotationIndex(Type type) throws CASRuntimeException;
+
+ /**
+ * Get the standard annotation index restricted to a specific annotation type.
+ *
+ * @param type
+ * The annotation type the index is restricted to,
+ * passed as an integer using the form
+ * MyAnnotationType.type
+ * @return The standard annotation index, restricted to <code>type</code>.
+ */
+ AnnotationIndex getAnnotationIndex(int type) throws CASRuntimeException;
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java?view=diff&rev=495621&r1=495620&r2=495621
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java Fri Jan 12 08:02:30 2007
@@ -65,6 +65,7 @@
import org.apache.uima.cas.impl.LowLevelException;
import org.apache.uima.cas.impl.LowLevelIndexRepository;
import org.apache.uima.cas.impl.TypeImpl;
+import org.apache.uima.cas.text.AnnotationIndex;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JFSIndexRepository;
import org.apache.uima.jcas.cas.FSArray;
@@ -1043,6 +1044,27 @@
//TODO improve this to account for JCas
// structure sizes
return casImpl.size();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.jcas.JCas#getAnnotationIndex()
+ */
+ public AnnotationIndex getAnnotationIndex() {
+ return casImpl.getAnnotationIndex();
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.jcas.JCas#getAnnotationIndex(org.apache.uima.cas.Type)
+ */
+ public AnnotationIndex getAnnotationIndex(Type type) throws CASRuntimeException {
+ return casImpl.getAnnotationIndex(type);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.jcas.JCas#getAnnotationIndex(int)
+ */
+ public AnnotationIndex getAnnotationIndex(int type) throws CASRuntimeException {
+ return casImpl.getAnnotationIndex(this.getCasType(type));
}
}