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/08/02 02:19:59 UTC
svn commit: r1803745 -
/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
Author: schor
Date: Wed Aug 2 02:19:58 2017
New Revision: 1803745
URL: http://svn.apache.org/viewvc?rev=1803745&view=rev
Log:
no Jira add default methods for variants taking a clazz arg
Modified:
uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java?rev=1803745&r1=1803744&r2=1803745&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java (original)
+++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java Wed Aug 2 02:19:58 2017
@@ -595,12 +595,38 @@ public interface JCas extends AbstractCa
void removeAllIncludingSubtypes(int i);
/**
+ * Remove all instances of type, including all subtypes from all indexes in the repository view.
+ * @param clazz the JCas class of the type to remove. To remove all use TOP.class
+ * @exception NullPointerException if the <code>clazz</code> parameter is <code>null</code>.
+ */
+ default <T extends TOP> void removeAllIncludingSubtypes(Class<T> clazz) {
+ getFSIndexRepository().removeAllIncludingSubtypes(getCasType(clazz));
+ }
+
+ /**
* Remove all feature structures of a given type (excluding subtypes) from all indexes in the repository associated with this CAS View.
* @param i the CAS type constant, written as Foo.type (for a given JCas Type) or anInstanceOfFoo.getTypeIndexID(), for an instance
*/
void removeAllExcludingSubtypes(int i);
/**
+ * Remove all instances of just this type, excluding subtypes, from all indexes in the repository view.
+ * @param clazz the JCas Class of the type to remove
+ * @exception NullPointerException if the <code>type</code> parameter is <code>null</code>.
+ */
+ default <T extends TOP> void removeAllExcludingSubtypes(Class<T> clazz) {
+ getFSIndexRepository().removeAllExcludingSubtypes(getCasType(clazz));
+ }
+
+ /**
+ * Return the UIMA Type object corresponding to this JCas's JCas cover class
+ * (Note: different JCas's, with different type systems, may share the same cover class impl)
+ * @param clazz a JCas cover class
+ * @return the corresponding UIMA Type object
+ */
+ public Type getCasType(Class<? extends FeatureStructure> clazz);
+
+ /**
* Get the standard annotation index.
*
* @return The standard annotation index.