You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2017/01/19 18:51:01 UTC

svn commit: r1779508 - in /uima/uimaj/branches/experiment-v3-jcas: uimaj-core/src/main/java/org/apache/uima/cas/ uimaj-core/src/main/java/org/apache/uima/cas/impl/ uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/

Author: schor
Date: Thu Jan 19 18:51:01 2017
New Revision: 1779508

URL: http://svn.apache.org/viewvc?rev=1779508&view=rev
Log:
[UIMA-5267] finish impl of built-in new types, jcasgen definition

Modified:
    uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/TypeSystem.java
    uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java
    uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/Jg.java

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/TypeSystem.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/TypeSystem.java?rev=1779508&r1=1779507&r2=1779508&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/TypeSystem.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/TypeSystem.java Thu Jan 19 18:51:01 2017
@@ -182,9 +182,4 @@ public interface TypeSystem {
    *         this type system.
    */
   LowLevelTypeSystem getLowLevelTypeSystem();
-
-  /**
-   * Add prebuilt types to the type system.
-   */
-  void addPrebuilt();
 }

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java?rev=1779508&r1=1779507&r2=1779508&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java Thu Jan 19 18:51:01 2017
@@ -308,7 +308,11 @@ public class TypeSystemImpl implements T
   public final TypeImpl_list intNeListType;
   public final TypeImpl_list floatNeListType;
   public final TypeImpl_list stringNeListType;
-  public final TypeImpl_list fsNeListType;  
+  public final TypeImpl_list fsNeListType;
+
+  public final TypeImpl      fsArrayListType;
+  public final TypeImpl      intArrayListType;
+  public final TypeImpl      fsHashSetType;
             
 //  /**
 //   * List indexed by typecode
@@ -511,7 +515,15 @@ public class TypeSystemImpl implements T
     docType = new TypeImpl_annot(CAS.TYPE_NAME_DOCUMENT_ANNOTATION, this, annotType, Annotation.class);
     langFeat = (FeatureImpl) addFeature(CAS.FEATURE_BASE_NAME_LANGUAGE, docType, stringType, false);
     
-    addPrebuilt();
+    fsArrayListType = new TypeImpl(CAS.TYPE_NAME_FS_ARRAY_LIST, this, topType);
+    addFeature(CAS.FEATURE_BASE_NAME_FS_ARRAY, fsArrayListType, fsArrayType);
+    
+    intArrayListType = new TypeImpl(CAS.TYPE_NAME_INT_ARRAY_LIST, this, topType);
+    addFeature(CAS.FEATURE_BASE_NAME_INT_ARRAY, intArrayListType, intArrayType);
+    
+    fsHashSetType = new TypeImpl(CAS.TYPE_NAME_FS_HASH_SET, this, topType);
+    addFeature(CAS.FEATURE_BASE_NAME_FS_ARRAY, fsHashSetType, fsArrayType);
+
 //    javaObjectType = new TypeImpl_javaObject(CAS.TYPE_NAME_JAVA_OBJECT, this, topType, Object.class);
 //    javaObjectArrayType = addArrayType(javaObjectType, null, HEAP_STORED_ARRAY, JavaObjectArray.class);
     
@@ -607,6 +619,9 @@ public class TypeSystemImpl implements T
     setTypeFinal(stringNeListType);
     setTypeFinal(intNeListType);
     
+    setTypeFinal(fsArrayListType);
+    setTypeFinal(intArrayListType);
+    setTypeFinal(fsHashSetType);
 
     listBaseType.setFeatureFinal();
     fsListType.setFeatureFinal();
@@ -623,6 +638,10 @@ public class TypeSystemImpl implements T
     stringNeListType.setFeatureFinal();
     annotType.setFeatureFinal();
     annotBaseType.setFeatureFinal();
+    
+    fsArrayListType.setFeatureFinal();
+    intListType.setFeatureFinal();
+    fsHashSetType.setFeatureFinal();
 
 //    allTypesForByteCodeGen = new TypeImpl[] {
 //        booleanType, 
@@ -649,17 +668,6 @@ public class TypeSystemImpl implements T
 //        javaObjectArrayType};
     
   }
-
-  public void addPrebuilt() {
-    TypeImpl fsArrayList = new TypeImpl(CAS.TYPE_NAME_FS_ARRAY_LIST, this, topType);
-    addFeature(CAS.FEATURE_BASE_NAME_FS_ARRAY, fsArrayList, fsArrayType);
-    
-    TypeImpl intArrayList = new TypeImpl(CAS.TYPE_NAME_INT_ARRAY_LIST, this, topType);
-    addFeature(CAS.FEATURE_BASE_NAME_INT_ARRAY, intArrayList, intArrayType);
-    
-    TypeImpl fsHashSet = new TypeImpl(CAS.TYPE_NAME_FS_HASH_SET, this, topType);
-    addFeature(CAS.FEATURE_BASE_NAME_FS_ARRAY, fsHashSet, fsArrayType);
-  }
  
   // Some implementation helpers for users of the type system.
   final int getSmallestType() {

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/Jg.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/Jg.java?rev=1779508&r1=1779507&r2=1779508&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/Jg.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/Jg.java Thu Jan 19 18:51:01 2017
@@ -165,11 +165,12 @@ public class Jg {
       Type type = (Type) it.next();
       if (type.isFeatureFinal()) {
         noGenTypes.add(type.getName());
-        continue;
+        continue;  // skip if feature final
       }
       String typeName = type.getName();
       List<Feature> fs = type.getFeatures();
       List<Feature> features = new ArrayList<Feature>(fs.size());
+      // get list of features defined in this type excluding those defined in supertypes
       for (int i = 0; i < fs.size(); i++) {
         Feature f = fs.get(i);
         String fName = f.getName();
@@ -262,6 +263,9 @@ public class Jg {
             "org.apache.uima.jcas.cas.NonEmptyIntegerList");
     addBuiltInTypeInfo("uima.cas.NonEmptyStringList", "org.apache.uima.jcas.cas.NonEmptyStringList");
     addBuiltInTypeInfo("uima.cas.Sofa", "org.apache.uima.jcas.cas.Sofa");
+    addBuiltInTypeInfo("uima.cas.IntegerArrayList", "org.apache.uima.jcas.cas.IntegerArrayList");
+    addBuiltInTypeInfo("uima.cas.FSArrayList", "org.apache.uima.jcas.cas.FSArrayList");
+    addBuiltInTypeInfo("uima.cas.FSHashSet", "org.apache.uima.jcas.cas.FSHashSet");
   }
 
   /** The resource bundle. */