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 2006/12/26 20:24:38 UTC

svn commit: r490358 - in /incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima: cas/CAS.java cas/CommonCas.java jcas/JCas.java jcas/impl/JCasImpl.java

Author: schor
Date: Tue Dec 26 11:24:33 2006
New Revision: 490358

URL: http://svn.apache.org/viewvc?view=rev&rev=490358
Log:
UIMA-143 and 144 - Refactor CAS Interface into part which
can be shared in common with the JCas Interface.  Added new
shared common interface class (CommonCas), having sub-interfaces
CAS and JCas.  Found several missing (in interface) and wrong impls of things
in the process.  

Missing: getView(String local_name_of_sofa) and getView(SofaFS)
JCas impl of getView was always creating new JCas rather
than reusing existing one (if it exists).

Added additional methods to JCas with impls that just forward
to CASImpl, for things that should be common.

Found a lot of tests in the JCas to see if the JCas was 
associated with a "TCAS" style CAS.  These were removed -
because TCAS stuff has been moved to CAS.

Added:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CommonCas.java
Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
    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/cas/CAS.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java?view=diff&rev=490358&r1=490357&r2=490358
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java Tue Dec 26 11:24:33 2006
@@ -19,13 +19,9 @@
 
 package org.apache.uima.cas;
 
-import java.io.InputStream;
-
-import org.apache.uima.cas.admin.CASAdminException;
 import org.apache.uima.cas.impl.LowLevelCAS;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.cas.text.TCAS;
-import org.apache.uima.cas.text.TCASRuntimeException;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.impl.JCasImpl;
 
@@ -64,417 +60,7 @@
  * 
  * 
  */
-public interface CAS extends AbstractCas {
-
-  // //////////////////////////////////////////////////
-  // Type names
-
-  /**
-   * UIMA CAS name space.
-   */
-  static final String NAME_SPACE_UIMA_CAS = "uima" + TypeSystem.NAMESPACE_SEPARATOR + "cas";
-
-  /**
-   * UIMA CAS name space prefix to prepend to type names (adds an extra period to the name space
-   * proper.
-   */
-  static final String UIMA_CAS_PREFIX = NAME_SPACE_UIMA_CAS + TypeSystem.NAMESPACE_SEPARATOR;
-
-  /**
-   * Top type.
-   */
-  static final String TYPE_NAME_TOP = UIMA_CAS_PREFIX + "TOP";
-
-  /**
-   * Integer type.
-   */
-  static final String TYPE_NAME_INTEGER = UIMA_CAS_PREFIX + "Integer";
-
-  /**
-   * Float type.
-   */
-  static final String TYPE_NAME_FLOAT = UIMA_CAS_PREFIX + "Float";
-
-  /**
-   * String type.
-   */
-  static final String TYPE_NAME_STRING = UIMA_CAS_PREFIX + "String";
-
-  /**
-   * Boolean type.
-   */
-  static final String TYPE_NAME_BOOLEAN = UIMA_CAS_PREFIX + "Boolean";
-
-  /**
-   * Byte type.
-   */
-  static final String TYPE_NAME_BYTE = UIMA_CAS_PREFIX + "Byte";
-
-  /**
-   * Short type.
-   */
-  static final String TYPE_NAME_SHORT = UIMA_CAS_PREFIX + "Short";
-
-  /**
-   * Long type.
-   */
-  static final String TYPE_NAME_LONG = UIMA_CAS_PREFIX + "Long";
-
-  /**
-   * Double type.
-   */
-  static final String TYPE_NAME_DOUBLE = UIMA_CAS_PREFIX + "Double";
-
-  /**
-   * ArrayBase type.
-   */
-  static final String TYPE_NAME_ARRAY_BASE = UIMA_CAS_PREFIX + "ArrayBase";
-
-  /**
-   * Feature structure array type.
-   */
-  static final String TYPE_NAME_FS_ARRAY = UIMA_CAS_PREFIX + "FSArray";
-
-  /**
-   * Integer array type.
-   */
-  static final String TYPE_NAME_INTEGER_ARRAY = UIMA_CAS_PREFIX + "IntegerArray";
-
-  /**
-   * Float array type.
-   */
-  static final String TYPE_NAME_FLOAT_ARRAY = UIMA_CAS_PREFIX + "FloatArray";
-
-  /**
-   * String array type.
-   */
-  static final String TYPE_NAME_STRING_ARRAY = UIMA_CAS_PREFIX + "StringArray";
-
-  /**
-   * Boolean array type.
-   */
-  static final String TYPE_NAME_BOOLEAN_ARRAY = UIMA_CAS_PREFIX + "BooleanArray";
-
-  /**
-   * Byte array type.
-   */
-  static final String TYPE_NAME_BYTE_ARRAY = UIMA_CAS_PREFIX + "ByteArray";
-
-  /**
-   * Short array type.
-   */
-  static final String TYPE_NAME_SHORT_ARRAY = UIMA_CAS_PREFIX + "ShortArray";
-
-  /**
-   * Long array type.
-   */
-  static final String TYPE_NAME_LONG_ARRAY = UIMA_CAS_PREFIX + "LongArray";
-
-  /**
-   * Double array type.
-   */
-  static final String TYPE_NAME_DOUBLE_ARRAY = UIMA_CAS_PREFIX + "DoubleArray";
-
-  /**
-   * Sofa type.
-   */
-  static final String TYPE_NAME_SOFA = UIMA_CAS_PREFIX + "Sofa";
-
-  /**
-   * Name of annotation base type.
-   */
-  static final String TYPE_NAME_ANNOTATION_BASE = UIMA_CAS_PREFIX + "AnnotationBase";
-
-  // /////////////////////////////////////////////////////////////////////////
-  // Sofa features.
-
-  /**
-   * Base name of Sofa Number feature.
-   */
-  static final String FEATURE_BASE_NAME_SOFANUM = "sofaNum";
-
-  /**
-   * Base name of Sofa ID feature.
-   */
-  static final String FEATURE_BASE_NAME_SOFAID = "sofaID";
-
-  /**
-   * Base name of Sofa mime type feature.
-   */
-  static final String FEATURE_BASE_NAME_SOFAMIME = "mimeType";
-
-  /**
-   * Base name of Sofa URI feature.
-   */
-  static final String FEATURE_BASE_NAME_SOFAURI = "sofaURI";
-
-  /**
-   * Base name of Sofa string data feature.
-   */
-  static final String FEATURE_BASE_NAME_SOFASTRING = "sofaString";
-
-  /**
-   * Base name of Sofa array fs data feature.
-   */
-  static final String FEATURE_BASE_NAME_SOFAARRAY = "sofaArray";
-
-  /**
-   * Qualified name of Sofa number feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFANUM = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFANUM;
-
-  /**
-   * Qualified name of Sofa id feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFAID = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFAID;
-
-  /**
-   * Qualified name of Sofa mime type feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFAMIME = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFAMIME;
-
-  /**
-   * Qualified name of Sofa URI feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFAURI = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFAURI;
-
-  /**
-   * Qualified name of Sofa string data feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFASTRING = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFASTRING;
-
-  /**
-   * Qualified name of Sofa array fs data feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFAARRAY = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFAARRAY;
-
-  // ////////////////////////////////////////////////////////////////////////
-  // Other Sofa names
-
-  /**
-   * Sofa Index name.
-   */
-  static final String SOFA_INDEX_NAME = "SofaIndex";
-
-  /**
-   * Sofa name for the default text sofa.
-   * 
-   * @deprecated As of v2.0, this is replaced by {@link #NAME_DEFAULT_SOFA}, and the value has
-   *             changed. In general, user code should not need to refer to this name.
-   */
-  static final String NAME_DEFAULT_TEXT_SOFA = "_InitialView";
-
-  /**
-   * Sofa name for the initial view's sofa.
-   */
-  static final String NAME_DEFAULT_SOFA = "_InitialView";
-
-  /**
-   * Abstract list base type.
-   */
-  static final String TYPE_NAME_LIST_BASE = UIMA_CAS_PREFIX + "ListBase";
-
-  /**
-   * Feature structure list type.
-   */
-  static final String TYPE_NAME_FS_LIST = UIMA_CAS_PREFIX + "FSList";
-
-  /**
-   * Non-empty feature structure list type.
-   */
-  static final String TYPE_NAME_NON_EMPTY_FS_LIST = UIMA_CAS_PREFIX + "NonEmptyFSList";
-
-  /**
-   * Empty feature structure list type.
-   */
-  static final String TYPE_NAME_EMPTY_FS_LIST = UIMA_CAS_PREFIX + "EmptyFSList";
-
-  /**
-   * Integer list type.
-   */
-  static final String TYPE_NAME_INTEGER_LIST = UIMA_CAS_PREFIX + "IntegerList";
-
-  /**
-   * Non-empty integer list type.
-   */
-  static final String TYPE_NAME_NON_EMPTY_INTEGER_LIST = UIMA_CAS_PREFIX + "NonEmptyIntegerList";
-
-  /**
-   * Empty integer list type.
-   */
-  static final String TYPE_NAME_EMPTY_INTEGER_LIST = UIMA_CAS_PREFIX + "EmptyIntegerList";
-
-  /**
-   * Float list type.
-   */
-  static final String TYPE_NAME_FLOAT_LIST = UIMA_CAS_PREFIX + "FloatList";
-
-  /**
-   * Non-empty float list type.
-   */
-  static final String TYPE_NAME_NON_EMPTY_FLOAT_LIST = UIMA_CAS_PREFIX + "NonEmptyFloatList";
-
-  /**
-   * Empty float type.
-   */
-  static final String TYPE_NAME_EMPTY_FLOAT_LIST = UIMA_CAS_PREFIX + "EmptyFloatList";
-
-  /**
-   * String list type.
-   */
-  static final String TYPE_NAME_STRING_LIST = UIMA_CAS_PREFIX + "StringList";
-
-  /**
-   * Non-empty string list type.
-   */
-  static final String TYPE_NAME_NON_EMPTY_STRING_LIST = UIMA_CAS_PREFIX + "NonEmptyStringList";
-
-  /**
-   * Empty string list type.
-   */
-  static final String TYPE_NAME_EMPTY_STRING_LIST = UIMA_CAS_PREFIX + "EmptyStringList";
-
-  /**
-   * Base name of list head feature.
-   */
-  static final String FEATURE_BASE_NAME_HEAD = "head";
-
-  /**
-   * Base name of list tail feature.
-   */
-  static final String FEATURE_BASE_NAME_TAIL = "tail";
-
-  /**
-   * Qualified name of fs list head feature.
-   */
-  static final String FEATURE_FULL_NAME_FS_LIST_HEAD = TYPE_NAME_NON_EMPTY_FS_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
-
-  /**
-   * Qualified name of integer list head feature.
-   */
-  static final String FEATURE_FULL_NAME_INTEGER_LIST_HEAD = TYPE_NAME_NON_EMPTY_INTEGER_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
-
-  /**
-   * Qualified name of float list head feature.
-   */
-  static final String FEATURE_FULL_NAME_FLOAT_LIST_HEAD = TYPE_NAME_NON_EMPTY_FLOAT_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
-
-  /**
-   * Qualified name of string list head feature.
-   */
-  static final String FEATURE_FULL_NAME_STRING_LIST_HEAD = TYPE_NAME_NON_EMPTY_STRING_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
-
-  /**
-   * Qualified name of fs list tail feature.
-   */
-  static final String FEATURE_FULL_NAME_FS_LIST_TAIL = TYPE_NAME_NON_EMPTY_FS_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
-
-  /**
-   * Qualified name of integer list tail feature.
-   */
-  static final String FEATURE_FULL_NAME_INTEGER_LIST_TAIL = TYPE_NAME_NON_EMPTY_INTEGER_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
-
-  /**
-   * Qualified name of float list tail feature.
-   */
-  static final String FEATURE_FULL_NAME_FLOAT_LIST_TAIL = TYPE_NAME_NON_EMPTY_FLOAT_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
-
-  /**
-   * Qualified name of string list tail feature.
-   */
-  static final String FEATURE_FULL_NAME_STRING_LIST_TAIL = TYPE_NAME_NON_EMPTY_STRING_LIST
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
-
-  /**
-   * Name of TCAS (Text CAS) name space.
-   */
-  static final String NAME_SPACE_UIMA_TCAS = "uima" + TypeSystem.NAMESPACE_SEPARATOR + "tcas";
-
-  /**
-   * Name of annotation type.
-   */
-  static final String TYPE_NAME_ANNOTATION = NAME_SPACE_UIMA_TCAS + TypeSystem.NAMESPACE_SEPARATOR
-          + "Annotation";
-
-  /**
-   * Name of document annotation type.
-   */
-  static final String TYPE_NAME_DOCUMENT_ANNOTATION = NAME_SPACE_UIMA_TCAS
-          + TypeSystem.NAMESPACE_SEPARATOR + "DocumentAnnotation";
-
-  /**
-   * Sofa ID feature that is the handle to a text Sofa.
-   */
-  static final String FEATURE_BASE_NAME_SOFA = "sofa";
-
-  /**
-   * Base name of annotation begin feature.
-   */
-  static final String FEATURE_BASE_NAME_BEGIN = "begin";
-
-  /**
-   * Base name of annotation end feature.
-   */
-  static final String FEATURE_BASE_NAME_END = "end";
-
-  /**
-   * Base name of document language feature.
-   */
-  static final String FEATURE_BASE_NAME_LANGUAGE = "language";
-
-  /**
-   * Fully qualified name of annotation begin feature.
-   */
-  static final String FEATURE_FULL_NAME_BEGIN = TYPE_NAME_ANNOTATION + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_BEGIN;
-
-  /**
-   * Fully qualified name of annotation sofa feature.
-   */
-  static final String FEATURE_FULL_NAME_SOFA = TYPE_NAME_ANNOTATION + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_SOFA;
-
-  /**
-   * Fully qualified name of annotation end feature.
-   */
-  static final String FEATURE_FULL_NAME_END = TYPE_NAME_ANNOTATION + TypeSystem.FEATURE_SEPARATOR
-          + FEATURE_BASE_NAME_END;
-
-  /**
-   * Fully qualified name of document language feature.
-   */
-  static final String FEATURE_FULL_NAME_LANGUAGE = TYPE_NAME_DOCUMENT_ANNOTATION
-          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_LANGUAGE;
-
-  /**
-   * Name of the standard index on annotations. The standard index is automatically defined if you
-   * use a TCAS.
-   */
-  static final String STD_ANNOTATION_INDEX = "AnnotationIndex";
-
-  static final String DEFAULT_LANGUAGE_NAME = "x-unspecified";
-
-  /**
-   * Return the type system of this CAS instance.
-   * 
-   * @return The type system, or <code>null</code> if none is available.
-   * @exception CASRuntimeException
-   *              If the type system has not been committed.
-   */
-  TypeSystem getTypeSystem() throws CASRuntimeException;
+public interface CAS extends CommonCas {
 
   /**
    * Create a FS on the temporary (document) heap.
@@ -566,87 +152,6 @@
    */
   DoubleArrayFS createDoubleArrayFS(int length) throws CASRuntimeException;
 
-  /**
-   * Create a Subject of Analysis. The new sofaFS is automatically added to the SofaIndex.
-   * 
-   * @return The sofaFS.
-   * 
-   * @deprecated As of v2.0, use {@link #createView(String)} instead.
-   */
-  SofaFS createSofa(SofaID sofaID, String mimeType);
-
-  /**
-   * Get sofaFS for given Subject of Analysis ID.
-   * 
-   * @return The sofaFS.
-   * 
-   * @deprecated As of v2.0, use {#getView(String)}. From the view you can access the Sofa data, or
-   *             call {@link #getSofa()} if you truly need to access the SofaFS object.
-   */
-  SofaFS getSofa(SofaID sofaID);
-
-  /**
-   * Get iterator for all SofaFS in the CAS.
-   * 
-   * @return an iterator over SofaFS.
-   */
-  FSIterator getSofaIterator();
-
-  /**
-   * Create an iterator over structures satisfying a given constraint. Constraints are described in
-   * the javadocs for {@link ConstraintFactory} and related classes.
-   * 
-   * @param it
-   *          The input iterator.
-   * @param cons
-   *          The constraint specifying what structures should be returned.
-   * @return An iterator over FSs.
-   */
-  FSIterator createFilteredIterator(FSIterator it, FSMatchConstraint cons);
-
-  /**
-   * Get a constraint factory. A constraint factory is a simple way of creating
-   * {@link org.apache.uima.cas.FSMatchConstraint FSMatchConstraints}.
-   * 
-   * @return A constraint factory to create new FS constraints.
-   */
-  ConstraintFactory getConstraintFactory();
-
-  /**
-   * Create a feature path. This is mainly useful for creating
-   * {@link org.apache.uima.cas.FSMatchConstraint FSMatchConstraints}.
-   * 
-   * @return A new, empty feature path.
-   */
-  FeaturePath createFeaturePath();
-
-  /**
-   * Get the index repository.
-   * 
-   * @return The index repository, or <code>null</code> if none is available.
-   */
-  FSIndexRepository getIndexRepository();
-
-  /**
-   * Wrap a standard Java {@link java.util.ListIterator ListIterator} around an FSListIterator. Use
-   * if you feel more comfortable with java style iterators.
-   * 
-   * @param it
-   *          The <code>FSListIterator</code> to be wrapped.
-   * @return An equivalent <code>ListIterator</code>.
-   */
-  java.util.ListIterator fs2listIterator(FSIterator it);
-
-  /**
-   * Reset the CAS, emptying it of all content. Feature structures and iterators will no longer be
-   * valid. Note: this method may only be called from an application. Calling it from an annotator
-   * will trigger a runtime exception.
-   * 
-   * @throws CASRuntimeException
-   *           When called out of sequence.
-   * @see org.apache.uima.cas.admin.CASMgr
-   */
-  void reset() throws CASAdminException;
 
   /**
    * Get the JCas for this CAS.
@@ -680,6 +185,38 @@
   TCAS getTCAS(SofaFS aSofa);
 
   /**
+   * Get sofaFS for given Subject of Analysis ID.
+   * 
+   * @return The sofaFS.
+   * 
+   * @deprecated As of v2.0, use {#getView(String)}. From the view you can access the Sofa data, or
+   *             call {@link #getSofa()} if you truly need to access the SofaFS object.
+   */
+  SofaFS getSofa(SofaID sofaID);
+
+  /**
+   * Get the Sofa feature structure associated with this TCAS view.
+   * 
+   * @return The SofaFS associated with this TCAS.
+   */
+  SofaFS getSofa();
+  
+  /**
+   * Create a view and its underlying Sofa (subject of analysis). The view provides access to the
+   * Sofa data and the index repository that contains metadata (annotations and other feature
+   * structures) pertaining to that Sofa.
+   * 
+   * @param localViewName
+   *          the local name, before any sofa name mapping is done, for this view (note: this is the
+   *          same as the associated Sofa name).
+   * 
+   * @return The view corresponding to this local name.
+   * @throws CASRuntimeException
+   *           if a View with this name already exists in this CAS
+   */
+  CAS createView(String localViewName);
+
+  /**
    * Create a JCas view for a Sofa. Note: as of UIMA v2.0, can be replaced with
    * getView(sofaFS).getJCas().
    * 
@@ -706,21 +243,6 @@
   JCas getJCas(SofaID aSofaID) throws CASException;
 
   /**
-   * Create a view and its underlying Sofa (subject of analysis). The view provides access to the
-   * Sofa data and the index repository that contains metadata (annotations and other feature
-   * structures) pertaining to that Sofa.
-   * 
-   * @param localViewName
-   *          the local name, before any sofa name mapping is done, for this view (note: this is the
-   *          same as the associated Sofa name).
-   * 
-   * @return The view corresponding to this local name.
-   * @throws CASRuntimeException
-   *           if a View with this name already exists in this CAS
-   */
-  CAS createView(String localViewName);
-
-  /**
    * Get the view for a Sofa (subject of analysis). The view provides access to the Sofa data and
    * the index repository that contains metadata (annotations and other feature structures)
    * pertaining to that Sofa.
@@ -734,7 +256,7 @@
    *           if no View with this name exists in this CAS
    */
   CAS getView(String localViewName);
-
+  
   /**
    * Get the view for a Sofa (subject of analysis). The view provides access to the Sofa data and
    * the index repository that contains metadata (annotations and other feature structures)
@@ -747,14 +269,7 @@
    */
   CAS getView(SofaFS aSofa);
 
-  /**
-   * Get the view name. The view name is the same as the name of the view's Sofa, retrieved by
-   * getSofa().getSofaID(), except for the initial View before its Sofa has been created.
-   * 
-   * @return The name of the view
-   */
-  String getViewName();
-
+ 
   /**
    * Get an instance of the low-level CAS. Low-level and regular CAS can be used in parallel, all
    * data is always contained in both.
@@ -767,118 +282,6 @@
    */
   LowLevelCAS getLowLevelCAS();
 
-  /**
-   * Estimate the memory consumption of this CAS instance (in bytes).
-   * 
-   * @return The estimated memory used by this CAS instance.
-   */
-  int size();
-
-  /**
-   * Create a feature-value path from a string.
-   * 
-   * @param featureValuePath
-   *          String representation of the feature-value path.
-   * @return Feature-value path object.
-   * @throws CASRuntimeException
-   *           If the input string is not well-formed.
-   */
-  FeatureValuePath createFeatureValuePath(String featureValuePath) throws CASRuntimeException;
-
-  /**
-   * Set the document text. Once set, Sofa data is immutable, and cannot be set again until the CAS
-   * has been reset.
-   * 
-   * @param text
-   *          The text to be analyzed.
-   * @exception CASRuntimeException
-   *              If the Sofa data has already been set.
-   */
-  void setDocumentText(String text) throws TCASRuntimeException;
-
-  /**
-   * Set the document text. Once set, Sofa data is immutable, and cannot be set again until the CAS
-   * has been reset.
-   * 
-   * @param text
-   *          The text to be analyzed.
-   * @param mime
-   *          The mime type of the data
-   * @exception CASRuntimeException
-   *              If the Sofa data has already been set.
-   */
-  void setSofaDataString(String text, String mimetype) throws TCASRuntimeException;
-
-  /**
-   * Get the document text.
-   * 
-   * @return The text being analyzed.
-   */
-  String getDocumentText();
-
-  /**
-   * Sets the language for this document. This value sets the language feature of the special
-   * instance of DocumentAnnotation associated with this TCAS.
-   * 
-   * @param languageCode
-   * @throws TCASRuntimeException
-   */
-  void setDocumentLanguage(String languageCode) throws TCASRuntimeException;
-
-  /**
-   * Gets the language code for this document from the language feature of the special instance of
-   * the DocumentationAnnotation associated with this TCAS.
-   * 
-   * @return language identifier
-   */
-  String getDocumentLanguage();
-
-  /**
-   * Set the Sofa data as an ArrayFS. Once set, Sofa data is immutable, and cannot be set again
-   * until the CAS has been reset.
-   * 
-   * @param array
-   *          The ArrayFS to be analyzed.
-   * @param mime
-   *          The mime type of the data
-   * @exception CASRuntimeException
-   *              If the Sofa data has already been set.
-   */
-  void setSofaDataArray(FeatureStructure array, String mime) throws TCASRuntimeException;
-
-  /**
-   * Get the Sofa data array.
-   * 
-   * @return The Sofa Data being analyzed.
-   */
-  FeatureStructure getSofaDataArray();
-
-  /**
-   * Set the Sofa data as a URI. Once set, Sofa data is immutable, and cannot be set again until the
-   * CAS has been reset.
-   * 
-   * @param uri
-   *          The URI of the data to be analyzed.
-   * @param mime
-   *          The mime type of the data
-   * @exception CASRuntimeException
-   *              If the Sofa data has already been set.
-   */
-  void setSofaDataURI(String uri, String mime) throws TCASRuntimeException;
-
-  /**
-   * Get the Sofa data array.
-   * 
-   * @return The Sofa Data being analyzed.
-   */
-  String getSofaDataURI();
-
-  /**
-   * Get the Sofa data as a byte stream.
-   * 
-   * @return A stream handle to the Sofa Data.
-   */
-  InputStream getSofaDataStream();
 
   /**
    * Get the type object for the annotation type.
@@ -940,13 +343,6 @@
   AnnotationFS getDocumentAnnotation();
 
   /**
-   * Get the Sofa feature structure associated with this TCAS view.
-   * 
-   * @return The SofaFS associated with this TCAS.
-   */
-  SofaFS getSofa();
-
-  /**
    * Informs the CAS of relevant information about the component that is currently procesing it.
    * This is called by the framework automatically; users do not need to call it.
    * 
@@ -954,33 +350,5 @@
    *          information about the component that is currently processing this CAS.
    */
   void setCurrentComponentInfo(ComponentInfo info);
-
-  /**
-   * Add a feature structure to all appropriate indexes in the repository associated with this CAS
-   * View.
-   * 
-   * <p>
-   * <b>Important</b>: after you have called <code>addFsToIndexes(...)</code> on a FS, do not
-   * change the values of any features used for indexing. If you do, the index will become corrupted
-   * and may be unusable. If you need to change an index feature value, first call
-   * {@link #removeFsFromIndexes(FeatureStructure) removeFsFromIndexes(...)} on the FS, change the
-   * feature values, then call <code>addFsToIndexes(...)</code> again.
-   * 
-   * @param fs
-   *          The Feature Structure to be added.
-   * @exception NullPointerException
-   *              If the <code>fs</code> parameter is <code>null</code>.
-   */
-  void addFsToIndexes(FeatureStructure fs);
-
-  /**
-   * Remove a feature structure from all indexes in the repository associated with this CAS View.
-   * 
-   * @param fs
-   *          The Feature Structure to be removed.
-   * @exception NullPointerException
-   *              If the <code>fs</code> parameter is <code>null</code>.
-   */
-  void removeFsFromIndexes(FeatureStructure fs);
 
 }

Added: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CommonCas.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CommonCas.java?view=auto&rev=490358
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CommonCas.java (added)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/CommonCas.java Tue Dec 26 11:24:33 2006
@@ -0,0 +1,669 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.cas;
+
+import java.io.InputStream;
+
+import org.apache.uima.cas.admin.CASAdminException;
+import org.apache.uima.cas.text.TCASRuntimeException;
+
+/**
+ * This part of the CAS interface is shared among CAS and JCAS interfaces
+ */
+public interface CommonCas extends AbstractCas {
+  
+  // //////////////////////////////////////////////////
+  // Type names
+
+  /**
+   * UIMA CAS name space.
+   */
+  static final String NAME_SPACE_UIMA_CAS = "uima" + TypeSystem.NAMESPACE_SEPARATOR + "cas";
+
+  /**
+   * UIMA CAS name space prefix to prepend to type names (adds an extra period to the name space
+   * proper.
+   */
+  static final String UIMA_CAS_PREFIX = NAME_SPACE_UIMA_CAS + TypeSystem.NAMESPACE_SEPARATOR;
+
+  /**
+   * Top type.
+   */
+  static final String TYPE_NAME_TOP = UIMA_CAS_PREFIX + "TOP";
+
+  /**
+   * Integer type.
+   */
+  static final String TYPE_NAME_INTEGER = UIMA_CAS_PREFIX + "Integer";
+
+  /**
+   * Float type.
+   */
+  static final String TYPE_NAME_FLOAT = UIMA_CAS_PREFIX + "Float";
+
+  /**
+   * String type.
+   */
+  static final String TYPE_NAME_STRING = UIMA_CAS_PREFIX + "String";
+
+  /**
+   * Boolean type.
+   */
+  static final String TYPE_NAME_BOOLEAN = UIMA_CAS_PREFIX + "Boolean";
+
+  /**
+   * Byte type.
+   */
+  static final String TYPE_NAME_BYTE = UIMA_CAS_PREFIX + "Byte";
+
+  /**
+   * Short type.
+   */
+  static final String TYPE_NAME_SHORT = UIMA_CAS_PREFIX + "Short";
+
+  /**
+   * Long type.
+   */
+  static final String TYPE_NAME_LONG = UIMA_CAS_PREFIX + "Long";
+
+  /**
+   * Double type.
+   */
+  static final String TYPE_NAME_DOUBLE = UIMA_CAS_PREFIX + "Double";
+
+  /**
+   * ArrayBase type.
+   */
+  static final String TYPE_NAME_ARRAY_BASE = UIMA_CAS_PREFIX + "ArrayBase";
+
+  /**
+   * Feature structure array type.
+   */
+  static final String TYPE_NAME_FS_ARRAY = UIMA_CAS_PREFIX + "FSArray";
+
+  /**
+   * Integer array type.
+   */
+  static final String TYPE_NAME_INTEGER_ARRAY = UIMA_CAS_PREFIX + "IntegerArray";
+
+  /**
+   * Float array type.
+   */
+  static final String TYPE_NAME_FLOAT_ARRAY = UIMA_CAS_PREFIX + "FloatArray";
+
+  /**
+   * String array type.
+   */
+  static final String TYPE_NAME_STRING_ARRAY = UIMA_CAS_PREFIX + "StringArray";
+
+  /**
+   * Boolean array type.
+   */
+  static final String TYPE_NAME_BOOLEAN_ARRAY = UIMA_CAS_PREFIX + "BooleanArray";
+
+  /**
+   * Byte array type.
+   */
+  static final String TYPE_NAME_BYTE_ARRAY = UIMA_CAS_PREFIX + "ByteArray";
+
+  /**
+   * Short array type.
+   */
+  static final String TYPE_NAME_SHORT_ARRAY = UIMA_CAS_PREFIX + "ShortArray";
+
+  /**
+   * Long array type.
+   */
+  static final String TYPE_NAME_LONG_ARRAY = UIMA_CAS_PREFIX + "LongArray";
+
+  /**
+   * Double array type.
+   */
+  static final String TYPE_NAME_DOUBLE_ARRAY = UIMA_CAS_PREFIX + "DoubleArray";
+
+  /**
+   * Sofa type.
+   */
+  static final String TYPE_NAME_SOFA = UIMA_CAS_PREFIX + "Sofa";
+
+  /**
+   * Name of annotation base type.
+   */
+  static final String TYPE_NAME_ANNOTATION_BASE = UIMA_CAS_PREFIX + "AnnotationBase";
+  
+  // /////////////////////////////////////////////////////////////////////////
+  // Sofa features.
+
+  /**
+   * Base name of Sofa Number feature.
+   */
+  static final String FEATURE_BASE_NAME_SOFANUM = "sofaNum";
+
+  /**
+   * Base name of Sofa ID feature.
+   */
+  static final String FEATURE_BASE_NAME_SOFAID = "sofaID";
+
+  /**
+   * Base name of Sofa mime type feature.
+   */
+  static final String FEATURE_BASE_NAME_SOFAMIME = "mimeType";
+
+  /**
+   * Base name of Sofa URI feature.
+   */
+  static final String FEATURE_BASE_NAME_SOFAURI = "sofaURI";
+
+  /**
+   * Base name of Sofa string data feature.
+   */
+  static final String FEATURE_BASE_NAME_SOFASTRING = "sofaString";
+
+  /**
+   * Base name of Sofa array fs data feature.
+   */
+  static final String FEATURE_BASE_NAME_SOFAARRAY = "sofaArray";
+
+  /**
+   * Qualified name of Sofa number feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFANUM = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFANUM;
+
+  /**
+   * Qualified name of Sofa id feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFAID = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFAID;
+
+  /**
+   * Qualified name of Sofa mime type feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFAMIME = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFAMIME;
+
+  /**
+   * Qualified name of Sofa URI feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFAURI = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFAURI;
+
+  /**
+   * Qualified name of Sofa string data feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFASTRING = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFASTRING;
+
+  /**
+   * Qualified name of Sofa array fs data feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFAARRAY = TYPE_NAME_SOFA + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFAARRAY;
+
+  // ////////////////////////////////////////////////////////////////////////
+  // Other Sofa names
+
+  /**
+   * Sofa Index name.
+   */
+  static final String SOFA_INDEX_NAME = "SofaIndex";
+
+  /**
+   * Sofa name for the default text sofa.
+   * 
+   * @deprecated As of v2.0, this is replaced by {@link #NAME_DEFAULT_SOFA}, and the value has
+   *             changed. In general, user code should not need to refer to this name.
+   */
+  static final String NAME_DEFAULT_TEXT_SOFA = "_InitialView";
+
+  /**
+   * Sofa name for the initial view's sofa.
+   */
+  static final String NAME_DEFAULT_SOFA = "_InitialView";
+
+  /**
+   * Abstract list base type.
+   */
+  static final String TYPE_NAME_LIST_BASE = UIMA_CAS_PREFIX + "ListBase";
+
+  /**
+   * Feature structure list type.
+   */
+  static final String TYPE_NAME_FS_LIST = UIMA_CAS_PREFIX + "FSList";
+
+  /**
+   * Non-empty feature structure list type.
+   */
+  static final String TYPE_NAME_NON_EMPTY_FS_LIST = UIMA_CAS_PREFIX + "NonEmptyFSList";
+
+  /**
+   * Empty feature structure list type.
+   */
+  static final String TYPE_NAME_EMPTY_FS_LIST = UIMA_CAS_PREFIX + "EmptyFSList";
+
+  /**
+   * Integer list type.
+   */
+  static final String TYPE_NAME_INTEGER_LIST = UIMA_CAS_PREFIX + "IntegerList";
+
+  /**
+   * Non-empty integer list type.
+   */
+  static final String TYPE_NAME_NON_EMPTY_INTEGER_LIST = UIMA_CAS_PREFIX + "NonEmptyIntegerList";
+
+  /**
+   * Empty integer list type.
+   */
+  static final String TYPE_NAME_EMPTY_INTEGER_LIST = UIMA_CAS_PREFIX + "EmptyIntegerList";
+
+  /**
+   * Float list type.
+   */
+  static final String TYPE_NAME_FLOAT_LIST = UIMA_CAS_PREFIX + "FloatList";
+
+  /**
+   * Non-empty float list type.
+   */
+  static final String TYPE_NAME_NON_EMPTY_FLOAT_LIST = UIMA_CAS_PREFIX + "NonEmptyFloatList";
+
+  /**
+   * Empty float type.
+   */
+  static final String TYPE_NAME_EMPTY_FLOAT_LIST = UIMA_CAS_PREFIX + "EmptyFloatList";
+
+  /**
+   * String list type.
+   */
+  static final String TYPE_NAME_STRING_LIST = UIMA_CAS_PREFIX + "StringList";
+
+  /**
+   * Non-empty string list type.
+   */
+  static final String TYPE_NAME_NON_EMPTY_STRING_LIST = UIMA_CAS_PREFIX + "NonEmptyStringList";
+
+  /**
+   * Empty string list type.
+   */
+  static final String TYPE_NAME_EMPTY_STRING_LIST = UIMA_CAS_PREFIX + "EmptyStringList";
+
+  /**
+   * Base name of list head feature.
+   */
+  static final String FEATURE_BASE_NAME_HEAD = "head";
+
+  /**
+   * Base name of list tail feature.
+   */
+  static final String FEATURE_BASE_NAME_TAIL = "tail";
+
+  /**
+   * Qualified name of fs list head feature.
+   */
+  static final String FEATURE_FULL_NAME_FS_LIST_HEAD = TYPE_NAME_NON_EMPTY_FS_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
+
+  /**
+   * Qualified name of integer list head feature.
+   */
+  static final String FEATURE_FULL_NAME_INTEGER_LIST_HEAD = TYPE_NAME_NON_EMPTY_INTEGER_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
+
+  /**
+   * Qualified name of float list head feature.
+   */
+  static final String FEATURE_FULL_NAME_FLOAT_LIST_HEAD = TYPE_NAME_NON_EMPTY_FLOAT_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
+
+  /**
+   * Qualified name of string list head feature.
+   */
+  static final String FEATURE_FULL_NAME_STRING_LIST_HEAD = TYPE_NAME_NON_EMPTY_STRING_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_HEAD;
+
+  /**
+   * Qualified name of fs list tail feature.
+   */
+  static final String FEATURE_FULL_NAME_FS_LIST_TAIL = TYPE_NAME_NON_EMPTY_FS_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
+
+  /**
+   * Qualified name of integer list tail feature.
+   */
+  static final String FEATURE_FULL_NAME_INTEGER_LIST_TAIL = TYPE_NAME_NON_EMPTY_INTEGER_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
+
+  /**
+   * Qualified name of float list tail feature.
+   */
+  static final String FEATURE_FULL_NAME_FLOAT_LIST_TAIL = TYPE_NAME_NON_EMPTY_FLOAT_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
+
+  /**
+   * Qualified name of string list tail feature.
+   */
+  static final String FEATURE_FULL_NAME_STRING_LIST_TAIL = TYPE_NAME_NON_EMPTY_STRING_LIST
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_TAIL;
+
+  /**
+   * Name of TCAS (Text CAS) name space.
+   */
+  static final String NAME_SPACE_UIMA_TCAS = "uima" + TypeSystem.NAMESPACE_SEPARATOR + "tcas";
+
+  /**
+   * Name of annotation type.
+   */
+  static final String TYPE_NAME_ANNOTATION = NAME_SPACE_UIMA_TCAS + TypeSystem.NAMESPACE_SEPARATOR
+          + "Annotation";
+
+  /**
+   * Name of document annotation type.
+   */
+  static final String TYPE_NAME_DOCUMENT_ANNOTATION = NAME_SPACE_UIMA_TCAS
+          + TypeSystem.NAMESPACE_SEPARATOR + "DocumentAnnotation";
+
+  /**
+   * Sofa ID feature that is the handle to a text Sofa.
+   */
+  static final String FEATURE_BASE_NAME_SOFA = "sofa";
+
+  /**
+   * Base name of annotation begin feature.
+   */
+  static final String FEATURE_BASE_NAME_BEGIN = "begin";
+
+  /**
+   * Base name of annotation end feature.
+   */
+  static final String FEATURE_BASE_NAME_END = "end";
+
+  /**
+   * Base name of document language feature.
+   */
+  static final String FEATURE_BASE_NAME_LANGUAGE = "language";
+
+  /**
+   * Fully qualified name of annotation begin feature.
+   */
+  static final String FEATURE_FULL_NAME_BEGIN = TYPE_NAME_ANNOTATION + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_BEGIN;
+
+  /**
+   * Fully qualified name of annotation sofa feature.
+   */
+  static final String FEATURE_FULL_NAME_SOFA = TYPE_NAME_ANNOTATION + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_SOFA;
+
+  /**
+   * Fully qualified name of annotation end feature.
+   */
+  static final String FEATURE_FULL_NAME_END = TYPE_NAME_ANNOTATION + TypeSystem.FEATURE_SEPARATOR
+          + FEATURE_BASE_NAME_END;
+
+  /**
+   * Fully qualified name of document language feature.
+   */
+  static final String FEATURE_FULL_NAME_LANGUAGE = TYPE_NAME_DOCUMENT_ANNOTATION
+          + TypeSystem.FEATURE_SEPARATOR + FEATURE_BASE_NAME_LANGUAGE;
+
+  /**
+   * Name of the standard index on annotations. The standard index is automatically defined if you
+   * use a TCAS.
+   */
+  static final String STD_ANNOTATION_INDEX = "AnnotationIndex";
+
+  static final String DEFAULT_LANGUAGE_NAME = "x-unspecified";
+
+  
+  ///////////////////////////////////////////////////////////////////////////
+  //
+  //  Standard CAS Methods
+  //
+  ///////////////////////////////////////////////////////////////////////////
+  /**
+   * Return the type system of this CAS instance.
+   * 
+   * @return The type system, or <code>null</code> if none is available.
+   * @exception CASRuntimeException
+   *              If the type system has not been committed.
+   */
+  TypeSystem getTypeSystem() throws CASRuntimeException;
+  
+  /**
+   * Create a Subject of Analysis. The new sofaFS is automatically added to the SofaIndex.
+   * 
+   * @return The sofaFS.
+   * 
+   * @deprecated As of v2.0, use {@link #createView(String)} instead.
+   */
+  SofaFS createSofa(SofaID sofaID, String mimeType);
+
+  /**
+   * Get iterator for all SofaFS in the CAS.
+   * 
+   * @return an iterator over SofaFS.
+   */
+  FSIterator getSofaIterator();
+
+  /**
+   * Create an iterator over structures satisfying a given constraint. Constraints are described in
+   * the javadocs for {@link ConstraintFactory} and related classes.
+   * 
+   * @param it
+   *          The input iterator.
+   * @param cons
+   *          The constraint specifying what structures should be returned.
+   * @return An iterator over FSs.
+   */
+  FSIterator createFilteredIterator(FSIterator it, FSMatchConstraint cons);
+
+  /**
+   * Get a constraint factory. A constraint factory is a simple way of creating
+   * {@link org.apache.uima.cas.FSMatchConstraint FSMatchConstraints}.
+   * 
+   * @return A constraint factory to create new FS constraints.
+   */
+  ConstraintFactory getConstraintFactory();
+
+  /**
+   * Create a feature path. This is mainly useful for creating
+   * {@link org.apache.uima.cas.FSMatchConstraint FSMatchConstraints}.
+   * 
+   * @return A new, empty feature path.
+   */
+  FeaturePath createFeaturePath();
+
+  /**
+   * Get the index repository.
+   * 
+   * @return The index repository, or <code>null</code> if none is available.
+   */
+  FSIndexRepository getIndexRepository();
+
+  /**
+   * Wrap a standard Java {@link java.util.ListIterator ListIterator} around an FSListIterator. Use
+   * if you feel more comfortable with java style iterators.
+   * 
+   * @param it
+   *          The <code>FSListIterator</code> to be wrapped.
+   * @return An equivalent <code>ListIterator</code>.
+   */
+  java.util.ListIterator fs2listIterator(FSIterator it);
+
+  /**
+   * Reset the CAS, emptying it of all content. Feature structures and iterators will no longer be
+   * valid. Note: this method may only be called from an application. Calling it from an annotator
+   * will trigger a runtime exception.
+   * 
+   * @throws CASRuntimeException
+   *           When called out of sequence.
+   * @see org.apache.uima.cas.admin.CASMgr
+   */
+  void reset() throws CASAdminException;
+  
+  /**
+   * Get the view name. The view name is the same as the name of the view's Sofa, retrieved by
+   * getSofa().getSofaID(), except for the initial View before its Sofa has been created.
+   * 
+   * @return The name of the view
+   */
+  String getViewName();
+
+  /**
+   * Estimate the memory consumption of this CAS instance (in bytes).
+   * 
+   * @return The estimated memory used by this CAS instance.
+   */
+  int size();
+
+  /**
+   * Create a feature-value path from a string.
+   * 
+   * @param featureValuePath
+   *          String representation of the feature-value path.
+   * @return Feature-value path object.
+   * @throws CASRuntimeException
+   *           If the input string is not well-formed.
+   */
+  FeatureValuePath createFeatureValuePath(String featureValuePath) throws CASRuntimeException;
+
+  /**
+   * Set the document text. Once set, Sofa data is immutable, and cannot be set again until the CAS
+   * has been reset.
+   * 
+   * @param text
+   *          The text to be analyzed.
+   * @exception CASRuntimeException
+   *              If the Sofa data has already been set.
+   */
+  void setDocumentText(String text) throws TCASRuntimeException;
+
+  /**
+   * Set the document text. Once set, Sofa data is immutable, and cannot be set again until the CAS
+   * has been reset.
+   * 
+   * @param text
+   *          The text to be analyzed.
+   * @param mime
+   *          The mime type of the data
+   * @exception CASRuntimeException
+   *              If the Sofa data has already been set.
+   */
+  void setSofaDataString(String text, String mimetype) throws TCASRuntimeException;
+
+  /**
+   * Get the document text.
+   * 
+   * @return The text being analyzed.
+   */
+  String getDocumentText();
+
+  /**
+   * Sets the language for this document. This value sets the language feature of the special
+   * instance of DocumentAnnotation associated with this TCAS.
+   * 
+   * @param languageCode
+   * @throws TCASRuntimeException
+   */
+  void setDocumentLanguage(String languageCode) throws TCASRuntimeException;
+
+  /**
+   * Gets the language code for this document from the language feature of the special instance of
+   * the DocumentationAnnotation associated with this TCAS.
+   * 
+   * @return language identifier
+   */
+  String getDocumentLanguage();
+
+  /**
+   * Set the Sofa data as an ArrayFS. Once set, Sofa data is immutable, and cannot be set again
+   * until the CAS has been reset.
+   * 
+   * @param array
+   *          The ArrayFS to be analyzed.
+   * @param mime
+   *          The mime type of the data
+   * @exception CASRuntimeException
+   *              If the Sofa data has already been set.
+   */
+  void setSofaDataArray(FeatureStructure array, String mime) throws TCASRuntimeException;
+
+  /**
+   * Get the Sofa data array.
+   * 
+   * @return The Sofa Data being analyzed.
+   */
+  FeatureStructure getSofaDataArray();
+
+  /**
+   * Set the Sofa data as a URI. Once set, Sofa data is immutable, and cannot be set again until the
+   * CAS has been reset.
+   * 
+   * @param uri
+   *          The URI of the data to be analyzed.
+   * @param mime
+   *          The mime type of the data
+   * @exception CASRuntimeException
+   *              If the Sofa data has already been set.
+   */
+  void setSofaDataURI(String uri, String mime) throws TCASRuntimeException;
+
+  /**
+   * Get the Sofa data array.
+   * 
+   * @return The Sofa Data being analyzed.
+   */
+  String getSofaDataURI();
+
+  /**
+   * Get the Sofa data as a byte stream.
+   * 
+   * @return A stream handle to the Sofa Data.
+   */
+  InputStream getSofaDataStream();
+
+  /**
+   * Add a feature structure to all appropriate indexes in the repository associated with this CAS
+   * View.
+   * 
+   * <p>
+   * <b>Important</b>: after you have called <code>addFsToIndexes(...)</code> on a FS, do not
+   * change the values of any features used for indexing. If you do, the index will become corrupted
+   * and may be unusable. If you need to change an index feature value, first call
+   * {@link #removeFsFromIndexes(FeatureStructure) removeFsFromIndexes(...)} on the FS, change the
+   * feature values, then call <code>addFsToIndexes(...)</code> again.
+   * 
+   * @param fs
+   *          The Feature Structure to be added.
+   * @exception NullPointerException
+   *              If the <code>fs</code> parameter is <code>null</code>.
+   */
+  void addFsToIndexes(FeatureStructure fs);
+
+  /**
+   * Remove a feature structure from all indexes in the repository associated with this CAS View.
+   * 
+   * @param fs
+   *          The Feature Structure to be removed.
+   * @exception NullPointerException
+   *              If the <code>fs</code> parameter is <code>null</code>.
+   */
+  void removeFsFromIndexes(FeatureStructure fs);
+
+}

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=490358&r1=490357&r2=490358
==============================================================================
--- 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 Tue Dec 26 11:24:33 2006
@@ -19,26 +19,19 @@
  
 package org.apache.uima.jcas;
 
-import java.io.InputStream;
-
-import org.apache.uima.cas.AbstractCas;
+import org.apache.uima.cas.CommonCas;
 import org.apache.uima.cas.CAS;
 import org.apache.uima.cas.CASException;
-import org.apache.uima.cas.CasOwner;
-import org.apache.uima.cas.ConstraintFactory;
 import org.apache.uima.cas.FSIndexRepository;
-import org.apache.uima.cas.FSIterator;
-import org.apache.uima.cas.FSMatchConstraint;
 import org.apache.uima.cas.Feature;
-import org.apache.uima.cas.FeaturePath;
 import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.SofaFS;
 import org.apache.uima.cas.SofaID;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
 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.TCASRuntimeException;
 import org.apache.uima.jcas.cas.FSArray;
 import org.apache.uima.jcas.cas.FloatArray;
 import org.apache.uima.jcas.cas.IntegerArray;
@@ -65,7 +58,7 @@
  * method on the CAS object. 
  */
 
-public interface JCas extends AbstractCas {
+public interface JCas extends CommonCas {
 
   /**
    * (internal use)
@@ -149,9 +142,6 @@
    */
   public abstract TOP getJfsFromCaddr(int casAddr);
 
-  /** calls the cas reset() function */
-  public abstract void reset();
-
   public abstract void checkArrayBounds(int fsRef, int pos);
 
   /**
@@ -166,8 +156,6 @@
 
   public abstract JCas getJCas(Sofa sofa) throws CASException;
 
-  public abstract FSIterator getSofaIterator();
-
   public abstract JFSIndexRepository getJFSIndexRepository();
 
   /**
@@ -197,95 +185,6 @@
   public abstract TOP getDocumentAnnotationFs();
 
   /**
-   * @see org.apache.uima.cas.text.TCAS#getDocumentText
-   * 
-   * @return String representing the Sofa data
-   */
-  public abstract String getDocumentText();
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#getSofaDataArray
-   * 
-   * @return FSARRAY representing the Sofa data
-   */
-  public abstract FSArray getSofaDataArray();
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#getSofaDataURI
-   * 
-   * @return String holding the URI of the Sofa data
-   */
-  public abstract String getSofaDataURI();
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#setDocumentText
-   * 
-   */
-  public abstract void setDocumentText(String text) throws TCASRuntimeException;
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#setSofaDataString
-   * 
-   */
-  public abstract void setSofaDataString(String text, String mime) throws TCASRuntimeException;
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#setSofaDataArray
-   * 
-   */
-  public abstract void setSofaDataArray(TOP array, String mime) throws TCASRuntimeException;
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#setSofaDataURI
-   * 
-   */
-  public abstract void setSofaDataURI(String uri, String mime) throws TCASRuntimeException;
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#getDocumentLanguage
-   * 
-   * @return String representing the language of the document in the JCAS
-   */
-  public abstract String getDocumentLanguage();
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#setDocumentLanguage
-   * 
-   */
-  public abstract void setDocumentLanguage(String language) throws TCASRuntimeException;
-
-  /**
-   * @see org.apache.uima.cas.text.TCAS#getSofaDataStream
-   * 
-   * @return InputStream handle to the Sofa data
-   */
-  public abstract InputStream getSofaDataStream();
-
-  /**
-   * @see org.apache.uima.cas.CAS#getConstraintFactory
-   * @return ConstraintFactory instance
-   */
-  public abstract ConstraintFactory getConstraintFactory();
-
-  /**
-   * @see org.apache.uima.cas.CAS#createFeaturePath
-   * 
-   * @return FeaturePath instance
-   */
-  public abstract FeaturePath createFeaturePath();
-
-  /**
-   * @see org.apache.uima.cas.CAS#createFilteredIterator
-   * 
-   * @param it
-   *          the iterator to filter
-   * @param constraint
-   *          the constraint to apply to the iterator to filter the results
-   * @return a filtered iterator
-   */
-  public abstract FSIterator createFilteredIterator(FSIterator it, FSMatchConstraint constraint);
-
-  /**
    * A constant for each cas which holds a 0-length instance. Since this can be a common value, we
    * avoid creating multiple copies of it. All uses can use the same valuee because it is not
    * updatable (it has no subfields). This is initialized lazily on first reference, and reset when
@@ -325,32 +224,31 @@
    */
   public abstract void processInit();
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.uima.cas.AbstractCas_ImplBase#setOwn
-   */
-  public abstract void setOwner(CasOwner aCasOwner);
-
-  /**
-   * @see org.apache.uima.cas.AbstractCas_ImplBase#release()
-   */
-  public abstract void release();
-
   /**
-   * @see org.apache.uima.cas.CAS#getView(String localViewName);
+   * Get the view for a Sofa (subject of analysis). The view provides access to the Sofa data and
+   * the index repository that contains metadata (annotations and other feature structures)
+   * pertaining to that Sofa.
+   * 
    * @param localViewName
-   * @return
+   *          the local name, before any sofa name mapping is done, for this view (note: this is the
+   *          same as the associated Sofa name).
+   * 
+   * @return The view corresponding to this local name.
    * @throws CASException
+   *           
    */
-  public abstract JCas getView(String localViewName) throws CASException;
-
+  JCas getView(String localViewName) throws CASException;
+  
   /**
-   * @see org.apache.uima.cas.CAS#addFsToIndexes(FeatureStructure);
-   * @param instance
+   * Get the view for a Sofa (subject of analysis). The view provides access to the Sofa data and
+   * the index repository that contains metadata (annotations and other feature structures)
+   * pertaining to that Sofa.
+   * 
+   * @param aSofa
+   *          a Sofa feature structure in the CAS
+   * 
+   * @return The view for the given Sofa
    */
-  public abstract void addFsToIndexes(FeatureStructure instance);
-
-  public abstract void removeFsFromIndexes(FeatureStructure instance);
+  JCas getView(SofaFS aSofa) throws CASException;
 
 }

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=490358&r1=490357&r2=490358
==============================================================================
--- 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 Tue Dec 26 11:24:33 2006
@@ -38,6 +38,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.ListIterator;
 import java.util.Map;
 
 import org.apache.uima.cas.AbstractCas;
@@ -53,6 +54,8 @@
 import org.apache.uima.cas.Feature;
 import org.apache.uima.cas.FeaturePath;
 import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.FeatureValuePath;
+import org.apache.uima.cas.SofaFS;
 import org.apache.uima.cas.SofaID;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
@@ -62,7 +65,6 @@
 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.TCAS;
 import org.apache.uima.cas.text.TCASRuntimeException;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.JFSIndexRepository;
@@ -210,7 +212,19 @@
   // * Access to this data is assumed to be single threaded
   // *******************
 
-  /** key = CAS addr, value = corresponding Java instance */
+  /** key = CAS addr, value = corresponding Java instance 
+   * The reason there are multiple cover objects per Cas object
+   * is that the JCas cover object distinguishes the CAS View
+   * the object belongs to, in order to support the
+   * methods:  aJCasCoverObjectInstance.addToIndexes()
+   * which needs to know which view to use
+   * This "convenience" of not needing to specify which CAS
+   * view to use here, is traded off with space: the same object
+   * indexed in multiple views ends up not "sharing" the Java
+   * cover object (because the objects are not identical - they
+   * refer to different views).
+   */
+
   public Map cAddr2Jfs;
 
   private int prevCaddr2JfsSize = INITIAL_HASHMAP_SIZE;
@@ -714,7 +728,7 @@
    * @see org.apache.uima.jcas.impl.IJCas#reset()
    */
   public void reset() {
-    getCas().reset();
+    casImpl.reset();
   }
 
   private final static int NULL = 0;
@@ -752,12 +766,7 @@
    * @see org.apache.uima.jcas.impl.IJCas#getSofa()
    */
   public Sofa getSofa() {
-    if (casImpl instanceof TCAS)
-      return (Sofa) ((TCAS) casImpl).getSofa();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getSofa()");
-    throw casEx;
+      return (Sofa) casImpl.getSofa();
   }
 
   /* (non-Javadoc)
@@ -771,7 +780,7 @@
    * @see org.apache.uima.jcas.impl.IJCas#getJCas(org.apache.uima.jcas.cas.Sofa)
    */
   public JCas getJCas(Sofa sofa) throws CASException {
-    return casImpl.getJCas(sofa);
+    return casImpl.getView(sofa).getJCas();
   }
 
   /* (non-Javadoc)
@@ -800,154 +809,84 @@
    * @see org.apache.uima.jcas.impl.IJCas#getDocumentAnnotation()
    */
   public DocumentAnnotation getDocumentAnnotation() {
-    if (casImpl instanceof TCAS)
-      return (DocumentAnnotation) ((TCAS) casImpl).getDocumentAnnotation();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getDocumentAnnotation()");
-    throw casEx;
+    return (DocumentAnnotation) casImpl.getDocumentAnnotation();
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#getDocumentAnnotationFs()
    */
   public TOP getDocumentAnnotationFs() {
-    if (casImpl instanceof TCAS)
-      return (TOP) ((TCAS) casImpl).getDocumentAnnotation();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getDocumentAnnotationFs()");
-    throw casEx;
+    return (TOP) casImpl.getDocumentAnnotation();
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#getDocumentText()
    */
   public String getDocumentText() {
-    if (casImpl instanceof TCAS)
-      return ((TCAS) casImpl).getDocumentText();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getDocumentText()");
-    throw casEx;
-  }
+    return casImpl.getDocumentText();
+ }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#getSofaDataArray()
    */
-  public FSArray getSofaDataArray() {
-    if (casImpl instanceof TCAS)
-      return (FSArray) ((TCAS) casImpl).getSofaDataArray();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getSofaDataArray()");
-    throw casEx;
+  public FeatureStructure getSofaDataArray() {
+    return casImpl.getSofaDataArray();
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#getSofaDataURI()
    */
   public String getSofaDataURI() {
-    if (casImpl instanceof TCAS)
-      return ((TCAS) casImpl).getSofaDataURI();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getSofaDataURI()");
-    throw casEx;
+    return casImpl.getSofaDataURI();
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#setDocumentText(java.lang.String)
    */
   public void setDocumentText(String text) throws TCASRuntimeException {
-    if (casImpl instanceof TCAS)
-      ((TCAS) casImpl).setDocumentText(text);
-    else {
-      CASRuntimeException casEx = new CASRuntimeException(
-              CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-      casEx.addArgument("setDocumentText(...)");
-      throw casEx;
-    }
+    casImpl.setDocumentText(text);
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#setSofaDataString(java.lang.String, java.lang.String)
    */
   public void setSofaDataString(String text, String mime) throws TCASRuntimeException {
-    if (casImpl instanceof TCAS)
-      ((TCAS) casImpl).setSofaDataString(text, mime);
-    else {
-      CASRuntimeException casEx = new CASRuntimeException(
-              CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-      casEx.addArgument("setSofaDataString(...)");
-      throw casEx;
-    }
+    casImpl.setSofaDataString(text, mime);
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#setSofaDataArray(org.apache.uima.jcas.cas.TOP, java.lang.String)
    */
-  public void setSofaDataArray(TOP array, String mime) throws TCASRuntimeException {
-    if (casImpl instanceof TCAS)
-      ((TCAS) casImpl).setSofaDataArray(array, mime);
-    else {
-      CASRuntimeException casEx = new CASRuntimeException(
-              CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-      casEx.addArgument("setSofaDataArray(...)");
-      throw casEx;
-    }
+  public void setSofaDataArray(FeatureStructure array, String mime) throws TCASRuntimeException {
+    casImpl.setSofaDataArray(array, mime);
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#setSofaDataURI(java.lang.String, java.lang.String)
    */
   public void setSofaDataURI(String uri, String mime) throws TCASRuntimeException {
-    if (casImpl instanceof TCAS)
-      ((TCAS) casImpl).setSofaDataURI(uri, mime);
-    else {
-      CASRuntimeException casEx = new CASRuntimeException(
-              CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-      casEx.addArgument("setSofaDataURI(...)");
-      throw casEx;
-    }
+    casImpl.setSofaDataURI(uri, mime);
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#getDocumentLanguage()
    */
   public String getDocumentLanguage() {
-    if (casImpl instanceof TCAS)
-      return ((TCAS) casImpl).getDocumentLanguage();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getDocumentLanguage()");
-    throw casEx;
+    return casImpl.getDocumentLanguage();
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#setDocumentLanguage(java.lang.String)
    */
   public void setDocumentLanguage(String language) throws TCASRuntimeException {
-    if (casImpl instanceof TCAS)
-      ((TCAS) casImpl).setDocumentLanguage(language);
-    else {
-      CASRuntimeException casEx = new CASRuntimeException(
-              CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-      casEx.addArgument("setDocumentLanguage(" + language + ")");
-      throw casEx;
-    }
+    casImpl.setDocumentLanguage(language);
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#getSofaDataStream()
    */
   public InputStream getSofaDataStream() {
-    if (casImpl instanceof TCAS)
-      return ((TCAS) casImpl).getSofaDataStream();
-    CASRuntimeException casEx = new CASRuntimeException(
-            CASRuntimeException.JCAS_UNSUPPORTED_OP_NOT_TCAS);
-    casEx.addArgument("getSofaDataArray()");
-    throw casEx;
+    return casImpl.getSofaDataStream();
   }
 
   /* (non-Javadoc)
@@ -1031,16 +970,21 @@
    * @see org.apache.uima.jcas.impl.IJCas#release()
    */
   public void release() {
-    getCas().release();
+    casImpl.release();
   }
 
   /* (non-Javadoc)
-   * @see org.apache.uima.jcas.impl.IJCas#getView(java.lang.String)
+   * @see org.apache.uima.jcas.JCas#getView(java.lang.String)
    */
   public JCas getView(String localViewName) throws CASException {
-    return getJCas((CASImpl) casImpl.getView(localViewName));
+    return casImpl.getView(localViewName).getJCas();
+  }
+  /* (non-Javadoc)
+   * @see org.apache.uima.jcas.JCas#getView(org.apache.uima.cas.SofaFS)
+   */
+  public JCas getView(SofaFS aSofa) throws CASException {
+    return casImpl.getView(aSofa).getJCas();
   }
-
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.impl.IJCas#addFsToIndexes(org.apache.uima.cas.FeatureStructure)
    */
@@ -1053,6 +997,53 @@
    */
   public void removeFsFromIndexes(FeatureStructure instance) {
     casImpl.removeFsFromIndexes(instance);
+  }
+
+  /**
+   * @see org.apache.uima.cas.CAS#fs2listIterator(FSIterator)
+   */
+  public ListIterator fs2listIterator(FSIterator it) {
+    return casImpl.fs2listIterator(it);
+  }
+
+  /* (non-Javadoc)
+   * @see org.apache.uima.cas.BaseCas#createFeatureValuePath(java.lang.String)
+   */
+  public FeatureValuePath createFeatureValuePath(String featureValuePath)
+          throws CASRuntimeException {
+    return casImpl.createFeatureValuePath(featureValuePath);
+  }
+
+  /* (non-Javadoc)
+   * @see org.apache.uima.cas.BaseCas#createSofa(org.apache.uima.cas.SofaID, java.lang.String)
+   * @deprecated
+   */
+  public SofaFS createSofa(SofaID sofaID, String mimeType) {
+    // extract absolute SofaName string from the ID
+    return casImpl.createSofa(sofaID, mimeType);
+  }
+
+  /* (non-Javadoc)
+   * @see org.apache.uima.cas.BaseCas#getIndexRepository()
+   */
+  public FSIndexRepository getIndexRepository() {
+    return casImpl.getIndexRepository();
+  }
+
+  /* (non-Javadoc)
+   * @see org.apache.uima.cas.BaseCas#getViewName()
+   */
+  public String getViewName() {
+    return casImpl.getViewName();
+  }
+
+  /* (non-Javadoc)
+   * @see org.apache.uima.cas.BaseCas#size()
+   */
+  public int size() {
+    //TODO improve this to account for JCas
+    //  structure sizes
+    return casImpl.size();
   }
 
 }