You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/05/22 16:03:40 UTC

svn commit: r540589 - in /incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima: cas/impl/ uimacpp/

Author: twgoetz
Date: Tue May 22 07:03:39 2007
New Revision: 540589

URL: http://svn.apache.org/viewvc?view=rev&rev=540589
Log:
Jira UIMA-408: CASImpl API clean-up.

https://issues.apache.org/jira/browse/UIMA-408

Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASMgrSerializer.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeImpl.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasDeserializer.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasSerializer.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/uimacpp/CppUimajEngine.java

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASMgrSerializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASMgrSerializer.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASMgrSerializer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASMgrSerializer.java Tue May 22 07:03:39 2007
@@ -352,34 +352,13 @@
     this.featDecls = new int[max * 2];
     Feature f;
     for (int i = ts.getSmallestFeature(); i < max; i++) {
-      f = ts.getFeature(i);
+      f = ts.ll_getFeatureForCode(i);
       this.featureNames[i] = f.getShortName();
       this.featDecls[i * 2] = ((TypeImpl) f.getDomain()).getCode();
       this.featDecls[(i * 2) + 1] = ((TypeImpl) f.getRange()).getCode();
     }
   }
 
-  // private void encodeFeatureDecls(TypeSystemImpl ts) {
-  // Iterator it = ts.getFeatures();
-  // ArrayList featList = new ArrayList();
-  // while (it.hasNext()) {
-  // featList.add(it.next());
-  // }
-  // this.featureNames = new String [featList.size()+1];
-  // featureNames[0] = null;
-  // for (int i = 0; i < featList.size(); i++) {
-  // featureNames[i+1] = ((Feature)featList.get(i)).getShortName();
-  // }
-  // IntVector vec = new IntVector();
-  // Feature f;
-  // for (int i = 0; i < featList.size(); i++) {
-  // f = (Feature)featList.get(i);
-  // vec.add(((TypeImpl)f.getDomain()).getCode());
-  // vec.add(((TypeImpl)f.getRange()).getCode());
-  // }
-  // this.featDecls = vec.toArray();
-  // }
-
   private void encodeTypeInheritance(TypeSystemImpl ts) {
     final int max = ts.getSmallestType() + ts.getNumberOfTypes();
     this.typeInheritance = new int[max];
@@ -507,7 +486,7 @@
         // System.out.println("Type system: " +
         // cas.getTypeSystem().toString());
         if (this.comparators[pos] > 0) {
-          feat = tsi.getFeature(this.comparators[pos]);
+          feat = tsi.ll_getFeatureForCode(this.comparators[pos]);
           // assert(feat != null);
           // System.out.println("Adding feature: " + feat.getName());
           ++pos;

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java Tue May 22 07:03:39 2007
@@ -75,7 +75,7 @@
 		if (this.getCASImpl().isIntType(rangeType) || this.getCASImpl().isFloatType(rangeType)
 				|| this.getCASImpl().isStringType(rangeType)) {
 			CASRuntimeException e = new CASRuntimeException(CASRuntimeException.PRIMITIVE_VAL_FEAT,
-					new String[] { this.getCASImpl().getTypeSystemImpl().getFeature(featCode).getName() });
+					new String[] { this.getCASImpl().getTypeSystemImpl().ll_getFeatureForCode(featCode).getName() });
 			throw e;
 		}
 		this.getCASImpl().setFeatureValue(this.getAddress(), featCode, CASImpl.NULL);

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeImpl.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeImpl.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeImpl.java Tue May 22 07:03:39 2007
@@ -213,7 +213,7 @@
     int[] feats = this.ts.ll_getAppropriateFeatures(this.code);
     ArrayList list = new ArrayList(feats.length);
     for (int i = 0; i < feats.length; i++) {
-      list.add(this.ts.getFeature(feats[i]));
+      list.add(this.ts.ll_getFeatureForCode(feats[i]));
     }
     return list;
   }

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java Tue May 22 07:03:39 2007
@@ -158,7 +158,7 @@
   // String sets for string subtypes.
   private final ArrayList stringSets;
 
-  // This map contains an entry for every subtype of the string type.  The value is a pointer into
+  // This map contains an entry for every subtype of the string type. The value is a pointer into
   // the stringSets array list.
   private final IntRedBlackTree stringSetMap;
 
@@ -181,9 +181,9 @@
   private static final int LEAST_FEATURE_CODE = 1;
 
   private int numCommittedTypes = 0;
-  
-  final CASMetadata casMetadata;  // needs to be visible in package
-  
+
+  final CASMetadata casMetadata; // needs to be visible in package
+
   boolean areBuiltInTypesSetup = false;
 
   TypeImpl intType;
@@ -215,7 +215,7 @@
   FeatureImpl endFeat;
 
   FeatureImpl langFeat;
-  
+
   FeatureImpl sofaNum;
 
   TypeImpl byteType;
@@ -238,7 +238,7 @@
 
   TypeImpl doubleArrayType;
 
- //  int topTypeCode;
+  // int topTypeCode;
   int intTypeCode = LowLevelTypeSystem.UNKNOWN_TYPE_CODE;
 
   int stringTypeCode = LowLevelTypeSystem.UNKNOWN_TYPE_CODE;
@@ -338,19 +338,19 @@
     this.arrayCodeToTypeMap = new RedBlackTree();
     this.parents = new IntVector();
     this.parents.add(0);
-    
+
     this.casMetadata = new CASMetadata(this);
     // load in built-in types
     CASImpl.setupTSDefault(this);
     initTypeVariables();
   }
-  
-  // only built-in types here; can be called before 
+
+  // only built-in types here; can be called before
   // type system is committed, as long as the built-in ones
   // are defined.
   final void initTypeVariables() {
     // Type objects.
-//    this.ts.topType = (TypeImpl) this.ts.getTopType();  // never used
+    // this.ts.topType = (TypeImpl) this.ts.getTopType(); // never used
     this.intType = (TypeImpl) getType(CAS.TYPE_NAME_INTEGER);
     this.stringType = (TypeImpl) getType(CAS.TYPE_NAME_STRING);
     this.floatType = (TypeImpl) getType(CAS.TYPE_NAME_FLOAT);
@@ -383,7 +383,6 @@
     initTypeCodeVars();
   }
 
-
   private final void initTypeCodeVars() {
     this.intTypeCode = this.intType.getCode();
     this.stringTypeCode = this.stringType.getCode();
@@ -407,28 +406,28 @@
     this.longArrayTypeCode = this.longArrayType.getCode();
     this.doubleTypeCode = this.doubleType.getCode();
     this.doubleArrayTypeCode = this.doubleArrayType.getCode();
-    
+
     this.arrayBaseTypeCode = this.arrayBaseType.getCode();
-   
+
     final Type sofaT = this.sofaType;
-    this.sofaNumFeatCode = ll_getCodeForFeature(
-            sofaT.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFANUM));
-    this.sofaIdFeatCode = ll_getCodeForFeature(
-            sofaT.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAID));
-    this.sofaMimeFeatCode = ll_getCodeForFeature(
-            sofaT.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAMIME));
-    this.sofaUriFeatCode = ll_getCodeForFeature(
-            sofaT.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAURI));
-    this.sofaArrayFeatCode = ll_getCodeForFeature(
-            sofaT.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAARRAY));
-    this.annotSofaFeatCode = ll_getCodeForFeature(
-        this.annotBaseType.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFA));
-    this.startFeatCode = ll_getCodeForFeature(
-        this.annotType.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_BEGIN));
-    this.endFeatCode = ll_getCodeForFeature(
-        this.annotType.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_END));
-    this.langFeatCode = ll_getCodeForFeature(
-        this.docType.getFeatureByBaseName(CAS.FEATURE_BASE_NAME_LANGUAGE));
+    this.sofaNumFeatCode = ll_getCodeForFeature(sofaT
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFANUM));
+    this.sofaIdFeatCode = ll_getCodeForFeature(sofaT
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAID));
+    this.sofaMimeFeatCode = ll_getCodeForFeature(sofaT
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAMIME));
+    this.sofaUriFeatCode = ll_getCodeForFeature(sofaT
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAURI));
+    this.sofaArrayFeatCode = ll_getCodeForFeature(sofaT
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFAARRAY));
+    this.annotSofaFeatCode = ll_getCodeForFeature(this.annotBaseType
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_SOFA));
+    this.startFeatCode = ll_getCodeForFeature(this.annotType
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_BEGIN));
+    this.endFeatCode = ll_getCodeForFeature(this.annotType
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_END));
+    this.langFeatCode = ll_getCodeForFeature(this.docType
+        .getFeatureByBaseName(CAS.FEATURE_BASE_NAME_LANGUAGE));
   }
 
   // Some implementation helpers for users of the type system.
@@ -469,8 +468,8 @@
   int ll_computeArrayParentFromComponentType(int componentType) {
     if (ll_isPrimitiveType(componentType) ||
     // note: not using this.top - until we can confirm this is set
-            // in all cases
-            (ll_getTypeForCode(componentType).getName().equals(CAS.TYPE_NAME_TOP))) {
+        // in all cases
+        (ll_getTypeForCode(componentType).getName().equals(CAS.TYPE_NAME_TOP))) {
       return ll_getCodeForTypeName(CAS.TYPE_NAME_ARRAY_BASE);
     }
     // is a subtype of FSArray.
@@ -536,9 +535,9 @@
    *          The code of the feature.
    * @return A feature object, or <code>null</code> if no such feature exists.
    */
-  public Feature getFeature(int featCode) {
-    return (Feature) this.features.get(featCode);
-  }
+//  public Feature getFeature(int featCode) {
+//    return (Feature) this.features.get(featCode);
+//  }
 
   /**
    * Get an feature object for a given name.
@@ -548,34 +547,32 @@
    * @return An feature object, or <code>null</code> if no such feature exists.
    */
   public Feature getFeatureByFullName(String featureName) {
-//    if (!this.featureMap.containsKey(featureName)) {
-//      return null;
-//    }
-//    final int featCode = this.featureMap.get(featureName);
-//    return (Feature) this.features.get(featCode);
+    // if (!this.featureMap.containsKey(featureName)) {
+    // return null;
+    // }
+    // final int featCode = this.featureMap.get(featureName);
+    // return (Feature) this.features.get(featCode);
     // will return null if feature not present because
-    //   the featureMap.get will return 0, and
-    //   getFeature returns null for code of 0
-    return getFeature(this.featureMap.get(featureName));
+    // the featureMap.get will return 0, and
+    // getFeature returns null for code of 0
+    return ll_getFeatureForCode(this.featureMap.get(featureName));
   }
 
   private static final String getArrayTypeName(String typeName) {
     final String arrayTypeName = (String) arrayComponentTypeNameMap.get(typeName);
-    return (null == arrayTypeName) ? 
-            typeName + arrayTypeSuffix :
-            arrayTypeName;
-//    if (arrayComponentTypeNameMap.containsKey(typeName)) {
-//      return (String) arrayComponentTypeNameMap.get(typeName);
-//    }
-//    return typeName + arrayTypeSuffix;
+    return (null == arrayTypeName) ? typeName + arrayTypeSuffix : arrayTypeName;
+    // if (arrayComponentTypeNameMap.containsKey(typeName)) {
+    // return (String) arrayComponentTypeNameMap.get(typeName);
+    // }
+    // return typeName + arrayTypeSuffix;
   }
 
   private static final String getBuiltinArrayComponent(String typeName) {
     // if typeName is not contained in the map, the "get" returns null
-//    if (arrayTypeComponentNameMap.containsKey(typeName)) {
-      return (String) arrayTypeComponentNameMap.get(typeName);
-//    }
-//    return null;
+    // if (arrayTypeComponentNameMap.containsKey(typeName)) {
+    return (String) arrayTypeComponentNameMap.get(typeName);
+    // }
+    // return null;
   }
 
   /**
@@ -656,7 +653,7 @@
       featCode = superApprop.get(i);
       typeApprop.add(featCode);
       // Add inherited feature names.
-      String feat = name + TypeSystem.FEATURE_SEPARATOR + getFeature(featCode).getShortName();
+      String feat = name + TypeSystem.FEATURE_SEPARATOR + ll_getFeatureForCode(featCode).getShortName();
       // System.out.println("Adding name: " + feat);
       this.featureMap.put(feat, featCode);
     }
@@ -675,7 +672,7 @@
   }
 
   public Feature addFeature(String featureName, Type domainType, Type rangeType)
-          throws CASAdminException {
+      throws CASAdminException {
     return addFeature(featureName, domainType, rangeType, true);
   }
 
@@ -683,7 +680,7 @@
    * @see TypeSystemMgr#addFeature(String, Type, Type)
    */
   public Feature addFeature(String featureName, Type domainType, Type rangeType,
-          boolean multipleReferencesAllowed) throws CASAdminException {
+      boolean multipleReferencesAllowed) throws CASAdminException {
     // assert(featureName != null);
     // assert(domainType != null);
     // assert(rangeType != null);
@@ -701,7 +698,7 @@
     }
     checkFeatureNameSyntax(featureName);
     final int featCode = this.addFeature(featureName, ((TypeImpl) domainType).getCode(),
-            ((TypeImpl) rangeType).getCode(), multipleReferencesAllowed);
+        ((TypeImpl) rangeType).getCode(), multipleReferencesAllowed);
     if (featCode < this.featureNameST.getStart()) {
       return null;
     }
@@ -915,7 +912,7 @@
     // Add entries for all subtypes.
     for (int i = 0; i < max; i++) {
       this.featureMap.put(((Type) typesLocal.get(i)).getName() + FEATURE_SEPARATOR + shortName,
-              feat);
+          feat);
     }
     this.intro.add(domain);
     this.featRange.add(range);
@@ -968,9 +965,9 @@
 
   private boolean ll_isPrimitiveArrayType(int type) {
     return type == this.floatArrayTypeCode || type == this.intArrayTypeCode
-            || type == this.booleanArrayTypeCode || type == this.shortArrayTypeCode
-            || type == this.byteArrayTypeCode || type == this.longArrayTypeCode
-            || type == this.doubleArrayTypeCode || type == this.stringArrayTypeCode;
+        || type == this.booleanArrayTypeCode || type == this.shortArrayTypeCode
+        || type == this.byteArrayTypeCode || type == this.longArrayTypeCode
+        || type == this.doubleArrayTypeCode || type == this.stringArrayTypeCode;
   }
 
   public boolean ll_subsumes(int superType, int type) {
@@ -999,7 +996,7 @@
 
     if (type == this.fsArrayTypeCode) {
       return superType == this.top || superType == this.arrayBaseTypeCode
-              || (!ll_isPrimitiveArrayType(superType) && ll_isArrayType(superType));
+          || (!ll_isPrimitiveArrayType(superType) && ll_isArrayType(superType));
     }
 
     // at this point, we could have arrays of other primitive types, or
@@ -1044,14 +1041,11 @@
     this.approp.add(new IntVector());
   }
 
-  public SymbolTable getTypeNameST() {
+  // Only used for serialization code.
+  SymbolTable getTypeNameST() {
     return this.typeNameST;
   }
 
-  public SymbolTable getFeatureNameST() {
-    return this.featureNameST;
-  }
-
   private final String getTypeString(Type t) {
     return t.getName() + " (" + ll_getCodeForType(t) + ")";
   }
@@ -1061,8 +1055,7 @@
   }
 
   /**
-   * This writes out the type hierarchy in a human-readable form. Files in this form can be read in
-   * by a {@link TypeSystemParser TypeSystemParser}.
+   * This writes out the type hierarchy in a human-readable form.
    */
   public String toString() {
     // This code is maximally readable, not maximally efficient.
@@ -1079,9 +1072,9 @@
     final int numFeats = this.featureNameST.size();
     Feature f;
     for (int i = 1; i <= numFeats; i++) {
-      f = this.getFeature(i);
+      f = this.ll_getFeatureForCode(i);
       buf.append(getFeatureString(f) + ": " + getTypeString(f.getDomain()) + " > "
-              + getTypeString(f.getRange()) + ";\n");
+          + getTypeString(f.getRange()) + ";\n");
     }
     return buf.toString();
   }
@@ -1104,7 +1097,6 @@
     // this.cas.commitTypeSystem();
     // }
   }
-  
 
   /**
    * @see org.apache.uima.cas.admin.TypeSystemMgr#isCommitted()
@@ -1143,7 +1135,7 @@
    */
   public Type addStringSubtype(String typeName, String[] stringList) throws CASAdminException {
     // final int stringSetCode = this.stringSets.size();
-    Type mother = getStringType();
+    Type mother = this.stringType;
     // Check type name syntax.
     checkTypeSyntax(typeName);
     // Create the type.
@@ -1163,13 +1155,9 @@
     return type;
   }
 
-  Type getStringType() {
-    return this.getType(CAS.TYPE_NAME_STRING);
-  }
-
-  public String[] getStringSet(int i) // public for ref from JCas TOP type,
+  // public for ref from JCas TOP type,
   // impl FeatureStructureImpl
-  {
+  public String[] getStringSet(int i) {
     return (String[]) this.stringSets.get(i);
   }
 
@@ -1227,11 +1215,11 @@
     return null;
   }
 
-  public final int getLargestFeatureCode() {
+  private final int getLargestFeatureCode() {
     return this.getNumberOfFeatures();
   }
 
-  public final boolean isFeature(int featureCode) {
+  final boolean isFeature(int featureCode) {
     return ((featureCode > UNKNOWN_FEATURE_CODE) && (featureCode <= getLargestFeatureCode()));
   }
 
@@ -1261,19 +1249,19 @@
   public boolean ll_isRefType(int typeCode) {
     final int typeClass = ll_getTypeClass(typeCode);
     switch (typeClass) {
-      case LowLevelCAS.TYPE_CLASS_BOOLEAN:
-      case LowLevelCAS.TYPE_CLASS_BYTE:
-      case LowLevelCAS.TYPE_CLASS_SHORT:
-      case LowLevelCAS.TYPE_CLASS_INT:
-      case LowLevelCAS.TYPE_CLASS_FLOAT:
-      case LowLevelCAS.TYPE_CLASS_LONG:
-      case LowLevelCAS.TYPE_CLASS_DOUBLE:
-      case LowLevelCAS.TYPE_CLASS_STRING: {
-        return false;
-      }
-      default: {
-        return true;
-      }
+    case LowLevelCAS.TYPE_CLASS_BOOLEAN:
+    case LowLevelCAS.TYPE_CLASS_BYTE:
+    case LowLevelCAS.TYPE_CLASS_SHORT:
+    case LowLevelCAS.TYPE_CLASS_INT:
+    case LowLevelCAS.TYPE_CLASS_FLOAT:
+    case LowLevelCAS.TYPE_CLASS_LONG:
+    case LowLevelCAS.TYPE_CLASS_DOUBLE:
+    case LowLevelCAS.TYPE_CLASS_STRING: {
+      return false;
+    }
+    default: {
+      return true;
+    }
     }
   }
 
@@ -1345,7 +1333,7 @@
       return this.componentToArrayTypeMap.get(componentTypeCode);
     }
     return addArrayType(ll_getTypeForCode(componentTypeCode),
-            ll_getTypeForCode(ll_computeArrayParentFromComponentType(componentTypeCode)));
+        ll_getTypeForCode(ll_computeArrayParentFromComponentType(componentTypeCode)));
   }
 
   int addArrayType(Type componentType, Type mother) {
@@ -1386,7 +1374,7 @@
 
   public boolean ll_isValidTypeCode(int typeCode) {
     return (this.typeNameST.getSymbol(typeCode) != null)
-            || this.arrayToComponentTypeMap.containsKey(typeCode);
+        || this.arrayToComponentTypeMap.containsKey(typeCode);
   }
 
   public boolean ll_isArrayType(int typeCode) {

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasDeserializer.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasDeserializer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasDeserializer.java Tue May 22 07:03:39 2007
@@ -674,7 +674,7 @@
         case LowLevelCAS.TYPE_CLASS_LONGARRAY:
         case LowLevelCAS.TYPE_CLASS_DOUBLEARRAY:
         case LowLevelCAS.TYPE_CLASS_FSARRAY: {
-          if (ts.getFeature(featCode).isMultipleReferencesAllowed()) {
+          if (ts.ll_getFeatureForCode(featCode).isMultipleReferencesAllowed()) {
             // do the usual FS deserialization
             try {
               if (!emptyVal(featVal)) {
@@ -702,7 +702,7 @@
         case XmiCasSerializer.TYPE_CLASS_FLOATLIST:
         case XmiCasSerializer.TYPE_CLASS_STRINGLIST:
         case XmiCasSerializer.TYPE_CLASS_FSLIST: {
-          if (ts.getFeature(featCode).isMultipleReferencesAllowed()) {
+          if (ts.ll_getFeatureForCode(featCode).isMultipleReferencesAllowed()) {
             // do the usual FS deserialization
             try {
               if (!emptyVal(featVal)) {
@@ -769,7 +769,7 @@
             throw new SAXParseException(I18nUtil.localizeMessage(
                     UIMAException.STANDARD_MESSAGE_CATALOG, Locale.getDefault(),
                     "multiple_values_unexpected",
-                    new Object[] { ts.getFeature(featCode).getName() }), locator);
+                    new Object[] { ts.ll_getFeatureForCode(featCode).getName() }), locator);
           } else {
             handleFeature(addr, featCode, (String) featVals.get(0));
           }
@@ -1049,7 +1049,7 @@
       int[] feats = casBeingFilled.getTypeSystemImpl().ll_getAppropriateFeatures(type);
       Feature feat;
       for (int i = 0; i < feats.length; i++) {
-        feat = ts.getFeature(feats[i]);
+        feat = ts.ll_getFeatureForCode(feats[i]);
         int typeCode = ts.ll_getRangeType(feats[i]);
         if (casBeingFilled.ll_isRefType(typeCode)
                 && (featureType[feats[i]] == LowLevelCAS.TYPE_CLASS_FS || feat

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasSerializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasSerializer.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasSerializer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/XmiCasSerializer.java Tue May 22 07:03:39 2007
@@ -464,7 +464,7 @@
           case LowLevelCAS.TYPE_CLASS_FSARRAY: {
             // we only enqueue arrays as first-class objects if the feature has
             // multipleReferencesAllowed = true
-            if (cas.getTypeSystemImpl().getFeature(feats[i]).isMultipleReferencesAllowed()) {
+            if (cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).isMultipleReferencesAllowed()) {
               enqueue(featVal);
             } else if (fsClass == LowLevelCAS.TYPE_CLASS_FSARRAY) {
               // but we do need to enqueue any FSs reachable from an FSArray
@@ -479,7 +479,7 @@
             // we only enqueue lists as first-class objects if the feature has
             // multipleReferencesAllowed = true
             // OR if we're already inside a list node (this handles the tail feature correctly)
-            if (cas.getTypeSystemImpl().getFeature(feats[i]).isMultipleReferencesAllowed() || insideListNode) {
+            if (cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).isMultipleReferencesAllowed() || insideListNode) {
               enqueue(featVal);
             } else if (fsClass == TYPE_CLASS_FSLIST) {
               // also, we need to enqueue any FSs reachable from an FSList
@@ -708,7 +708,7 @@
 
         featAddr = addr + cas.getFeatureOffset(feats[i]);
         featVal = cas.getHeapValue(featAddr);
-        featName = cas.getTypeSystemImpl().getFeature(feats[i]).getShortName();
+        featName = cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).getShortName();
         fsClass = classifyType(cas.getTypeSystemImpl().range(feats[i]));
         switch (fsClass) {
           case LowLevelCAS.TYPE_CLASS_INT:
@@ -740,7 +740,7 @@
           case LowLevelCAS.TYPE_CLASS_FSARRAY: {
             // If the feature has multipleReferencesAllowed = true, serialize as any other FS.
             // If false, serialize as a multi-valued property.
-            if (cas.getTypeSystemImpl().getFeature(feats[i]).isMultipleReferencesAllowed()) {
+            if (cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).isMultipleReferencesAllowed()) {
               attrValue = getXmiId(featVal);
             } else {
               attrValue = arrayToString(featVal, fsClass);
@@ -752,7 +752,7 @@
           case LowLevelCAS.TYPE_CLASS_STRINGARRAY: {
             // If the feature has multipleReferencesAllowed = true, serialize as any other FS.
             // If false, serialize as a multi-valued property.
-            if (cas.getTypeSystemImpl().getFeature(feats[i]).isMultipleReferencesAllowed()) {
+            if (cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).isMultipleReferencesAllowed()) {
               attrValue = getXmiId(featVal);
             } else {
               stringArrayToElementList(featName, featVal, childElements);
@@ -767,7 +767,7 @@
             // If the feature has multipleReferencesAllowed = true OR if we're already
             // inside another list node (i.e. this is the "tail" feature), serialize as a normal FS.
             // Otherwise, serialize as a multi-valued property.
-            if (cas.getTypeSystemImpl().getFeature(feats[i]).isMultipleReferencesAllowed() || insideListNode) {
+            if (cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).isMultipleReferencesAllowed() || insideListNode) {
               attrValue = getXmiId(featVal);
             } else {
               attrValue = listToString(featVal, fsClass);
@@ -777,7 +777,7 @@
             // special case for StringLists, which stored values as child elements rather
             // than attributes.
           case TYPE_CLASS_STRINGLIST: {
-            if (cas.getTypeSystemImpl().getFeature(feats[i]).isMultipleReferencesAllowed() || insideListNode) {
+            if (cas.getTypeSystemImpl().ll_getFeatureForCode(feats[i]).isMultipleReferencesAllowed() || insideListNode) {
               attrValue = getXmiId(featVal);
             } else {
               // it is not safe to use a space-separated attribute, which would

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/uimacpp/CppUimajEngine.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/uimacpp/CppUimajEngine.java?view=diff&rev=540589&r1=540588&r2=540589
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/uimacpp/CppUimajEngine.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/uimacpp/CppUimajEngine.java Tue May 22 07:03:39 2007
@@ -199,7 +199,7 @@
                           false);
         }
         for (int i = 0; i < resultSpecFeatures.length; ++i) {
-          rs.addResultFeature(casImpl.getTypeSystemImpl().getFeature(resultSpecFeatures[i])
+          rs.addResultFeature(casImpl.getTypeSystemImpl().ll_getFeatureForCode(resultSpecFeatures[i])
                   .getName());
         }
         // 3. call process with cas