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 2015/12/01 19:19:11 UTC

svn commit: r1717487 - in /uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples: SourceDocumentInformation.java SourceDocumentInformation_Type.java

Author: schor
Date: Tue Dec  1 18:19:11 2015
New Revision: 1717487

URL: http://svn.apache.org/viewvc?rev=1717487&view=rev
Log:
[UIMA-4666] update example SourceDocumentAnnotation JCas generated class for v3

Removed:
    uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples/SourceDocumentInformation_Type.java
Modified:
    uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java?rev=1717487&r1=1717486&r2=1717487&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java Tue Dec  1 18:19:11 2015
@@ -17,225 +17,164 @@
  * under the License.
  */
 
+/* Apache UIMA v3 - First created by JCasGen Tue Nov 24 20:24:47 EST 2015 */
+
 package org.apache.uima.examples;
 
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.TypeImpl;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.JCasRegistry;
+
 import org.apache.uima.jcas.tcas.Annotation;
 
-/**
- * Stores detailed information about the original source document from which the current CAS was
- * initialized. All information (like size) refers to the source document and not to the document in
- * the CAS which may be converted and filtered by a CAS Initializer. For example this information
- * will be written to the Semantic Search index so that the original document contents can be
- * retrieved by queries. Updated by JCasGen Wed Nov 22 16:51:13 EST 2006 XML source:
- * C:/alally/dev/workspace_apache/uimaj-examples/src/main/resources/org/apache/uima/examples/SourceDocumentInformation.xml
- * 
- * @generated
- */
+
+/** 
+ * Stores detailed information about the original source document from which the current CAS was initialized. 
+ * All information (like size) refers to the source document and not to the document in 
+ * the CAS which may be converted and filtered by a CAS Initializer. For example this information 
+ * will be written to the Semantic Search index so that the original document contents can be 
+ * retrieved by queries.
+ * Updated by JCasGen Tue Nov 24 20:24:47 EST 2015
+ * XML source: C:/au/svnCheckouts/branches/uimaj/experiment-v3-jcas/uimaj-examples/src/main/resources/org/apache/uima/examples/SourceDocumentInformation.xml
+ * @generated */
 public class SourceDocumentInformation extends Annotation {
-  /**
-   * @generated
+  /** @generated
    * @ordered
    */
+  @SuppressWarnings ("hiding")
   public final static int typeIndexID = JCasRegistry.register(SourceDocumentInformation.class);
-
-  /**
-   * @generated
+  /** @generated
    * @ordered
    */
+  @SuppressWarnings ("hiding")
   public final static int type = typeIndexID;
+  /** @generated
+   * @return index of the type
+   */
+  @Override
+  public              int getTypeIndexID() {return typeIndexID;}
 
-  /** @generated */
-  public int getTypeIndexID() {
-    return typeIndexID;
-  }
 
-  /**
-   * Never called. Disable default constructor
-   * 
-   * @generated
-   */
-  protected SourceDocumentInformation() {
-  }
+  /* *****************
+   *    Local Data   *
+   * *****************/
 
-  /**
-   * Internal - constructor used by generator
-   * 
-   * @param addr -
-   * @param type -
+  /* Register Features */
+  public final static int _FI_uri = JCasRegistry.registerFeature(typeIndexID);
+  public final static int _FI_offsetInSource = JCasRegistry.registerFeature(typeIndexID);
+  public final static int _FI_documentSize = JCasRegistry.registerFeature(typeIndexID);
+  public final static int _FI_lastSegment = JCasRegistry.registerFeature(typeIndexID);
+
+
+  private String _F_uri;  // URI of document. (For example, file:///MyDirectory/myFile.txt for a simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
+  private int _F_offsetInSource;  // Byte offset of the start of document content within original source file or other input source. Only used if the CAS document was retrieved from an source where one physical source file contained several conceptual documents. Zero otherwise.
+  private int _F_documentSize;  // Size of original document in bytes before processing by CAS Initializer. Either absolute file size of size within file or other source.
+  private boolean _F_lastSegment;  // For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document.  This is useful for downstream components that want to take some action after having seen all of the segments of a particular source document.
+
+  /** Never called.  Disable default constructor
+   * @generated */
+  protected SourceDocumentInformation() {/* intentionally empty block */}
+
+  /** Internal - constructor used by generator
    * @generated
+   * @param casImpl the CAS this Feature Structure belongs to
+   * @param type the type of this Feature Structure
    */
-  public SourceDocumentInformation(int addr, TOP_Type type) {
-    super(addr, type);
+  public SourceDocumentInformation(TypeImpl type, CASImpl casImpl) {
+    super(type, casImpl);
     readObject();
   }
 
-  /** 
-   * @generated
-   * @param jcas - 
-   * */
+  /** @generated
+   * @param jcas JCas to which this Feature Structure belongs
+   */
   public SourceDocumentInformation(JCas jcas) {
     super(jcas);
     readObject();
   }
 
-  /** 
-   * @generated
-   * @param jcas -
-   * @param begin -
-   * @param end - 
-   * */
-  public SourceDocumentInformation(JCas jcas, int begin, int end) {
-    super(jcas);
-    setBegin(begin);
-    setEnd(end);
-    readObject();
-  }
-
   /**
-   * <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc -->
-   * 
+   * <!-- begin-user-doc -->
+   * Write your own initialization here
+   * <!-- end-user-doc -->
+   *
    * @generated modifiable
    */
-  private void readObject() {
-  }
+  private void readObject() {/*default - does nothing empty block */}
 
-  // *--------------*
-  // * Feature: uri
 
-  /**
-   * getter for uri - gets URI of document. (For example, file:///MyDirectory/myFile.txt for a
-   * simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
-   * 
-   * @generated
-   * @return the Uri
-   */
-  public String getUri() {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_uri == null)
-      this.jcasType.jcas.throwFeatMissing("uri", "org.apache.uima.examples.SourceDocumentInformation");
-    return jcasType.ll_cas.ll_getStringValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_uri);
-  }
 
-  /**
-   * setter for uri - sets URI of document. (For example, file:///MyDirectory/myFile.txt for a
-   * simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
-   * 
-   * @param v this document's Uri
+  //*--------------*
+  //* Feature: uri
+
+  /** getter for uri - gets URI of document. (For example, file:///MyDirectory/myFile.txt for a simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
    * @generated
+   * @return value of the feature
+   */
+  public String getUri() { return _F_uri;}
+
+  /** setter for uri - sets URI of document. (For example, file:///MyDirectory/myFile.txt for a simple file or http://incubator.apache.org/uima/index.html for content from a web source.)
+   * @generated
+   * @param v value to set into the feature
    */
   public void setUri(String v) {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_uri == null)
-      this.jcasType.jcas.throwFeatMissing("uri", "org.apache.uima.examples.SourceDocumentInformation");
-    jcasType.ll_cas.ll_setStringValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_uri, v);
-  }
+              _casView.setWithCheckAndJournalJFRI(this, _FI_uri, () -> _F_uri = v);
+      }
 
-  // *--------------*
-  // * Feature: offsetInSource
 
-  /**
-   * getter for offsetInSource - gets Byte offset of the start of document content within original
-   * source file or other input source. Only used if the CAS document was retrieved from an source
-   * where one physical source file contained several conceptual documents. Zero otherwise.
-   * 
-   * @return the byte offset of the start of the document within the original
+  //*--------------*
+  //* Feature: offsetInSource
+
+  /** getter for offsetInSource - gets Byte offset of the start of document content within original source file or other input source. Only used if the CAS document was retrieved from an source where one physical source file contained several conceptual documents. Zero otherwise.
    * @generated
+   * @return value of the feature
    */
-  public int getOffsetInSource() {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_offsetInSource == null)
-      this.jcasType.jcas.throwFeatMissing("offsetInSource", "org.apache.uima.examples.SourceDocumentInformation");
-    return jcasType.ll_cas.ll_getIntValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_offsetInSource);
-  }
+  public int getOffsetInSource() { return _F_offsetInSource;}
 
-  /**
-   * setter for offsetInSource - sets Byte offset of the start of document content within original
-   * source file or other input source. Only used if the CAS document was retrieved from an source
-   * where one physical source file contained several conceptual documents. Zero otherwise.
-   * 
-   * @param v the byte offset of the start of the document within the original
+  /** setter for offsetInSource - sets Byte offset of the start of document content within original source file or other input source. Only used if the CAS document was retrieved from an source where one physical source file contained several conceptual documents. Zero otherwise.
    * @generated
+   * @param v value to set into the feature
    */
   public void setOffsetInSource(int v) {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_offsetInSource == null)
-      this.jcasType.jcas.throwFeatMissing("offsetInSource", "org.apache.uima.examples.SourceDocumentInformation");
-    jcasType.ll_cas.ll_setIntValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_offsetInSource, v);
-  }
+              _casView.setWithCheckAndJournalJFRI(this, _FI_offsetInSource, () -> _F_offsetInSource = v);
+      }
 
-  // *--------------*
-  // * Feature: documentSize
 
-  /**
-   * getter for documentSize - gets Size of original document in bytes before processing by CAS
-   * Initializer. Either absolute file size of size within file or other source.
-   * 
-   * @return the document size in bytes
+  //*--------------*
+  //* Feature: documentSize
+
+  /** getter for documentSize - gets Size of original document in bytes before processing by CAS Initializer. Either absolute file size of size within file or other source.
    * @generated
+   * @return value of the feature
    */
-  public int getDocumentSize() {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_documentSize == null)
-      this.jcasType.jcas.throwFeatMissing("documentSize", "org.apache.uima.examples.SourceDocumentInformation");
-    return jcasType.ll_cas.ll_getIntValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_documentSize);
-  }
+  public int getDocumentSize() { return _F_documentSize;}
 
-  /**
-   * setter for documentSize - sets Size of original document in bytes before processing by CAS
-   * Initializer. Either absolute file size of size within file or other source.
-   * 
-   * @param v the document size in bytes
+  /** setter for documentSize - sets Size of original document in bytes before processing by CAS Initializer. Either absolute file size of size within file or other source.
    * @generated
+   * @param v value to set into the feature
    */
   public void setDocumentSize(int v) {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_documentSize == null)
-      this.jcasType.jcas.throwFeatMissing("documentSize", "org.apache.uima.examples.SourceDocumentInformation");
-    jcasType.ll_cas.ll_setIntValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_documentSize, v);
-  }
+              _casView.setWithCheckAndJournalJFRI(this, _FI_documentSize, () -> _F_documentSize = v);
+      }
 
-  // *--------------*
-  // * Feature: lastSegment
 
-  /**
-   * getter for lastSegment - gets For a CAS that represents a segment of a larger source document,
-   * this flag indicates whether this CAS is the final segment of the source document. This is
-   * useful for downstream components that want to take some action after having seen all of the
-   * segments of a particular source document.
-   * 
-   * @return true if this is the final segment
+  //*--------------*
+  //* Feature: lastSegment
+
+  /** getter for lastSegment - gets For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document.  This is useful for downstream components that want to take some action after having seen all of the segments of a particular source document.
    * @generated
+   * @return value of the feature
    */
-  public boolean getLastSegment() {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_lastSegment == null)
-      this.jcasType.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
-    return jcasType.ll_cas.ll_getBooleanValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_lastSegment);
-  }
+  public boolean getLastSegment() { return _F_lastSegment;}
 
-  /**
-   * setter for lastSegment - sets For a CAS that represents a segment of a larger source document,
-   * this flag indicates whether this CAS is the final segment of the source document. This is
-   * useful for downstream components that want to take some action after having seen all of the
-   * segments of a particular source document.
-   * 
-   * @param v true if this is the last segment
+  /** setter for lastSegment - sets For a CAS that represents a segment of a larger source document, this flag indicates whether this CAS is the final segment of the source document.  This is useful for downstream components that want to take some action after having seen all of the segments of a particular source document.
    * @generated
+   * @param v value to set into the feature
    */
   public void setLastSegment(boolean v) {
-    if (SourceDocumentInformation_Type.featOkTst
-            && ((SourceDocumentInformation_Type) jcasType).casFeat_lastSegment == null)
-      this.jcasType.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
-    jcasType.ll_cas.ll_setBooleanValue(addr,
-            ((SourceDocumentInformation_Type) jcasType).casFeatCode_lastSegment, v);
+              _casView.setWithCheckAndJournalJFRI(this, _FI_lastSegment, () -> _F_lastSegment = v);
+      }
   }
-}
+
+