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 2016/07/18 13:38:34 UTC
svn commit: r1753222 - in
/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples:
SourceDocumentInformation.java SourceDocumentInformation_Type.java
Author: schor
Date: Mon Jul 18 13:38:34 2016
New Revision: 1753222
URL: http://svn.apache.org/viewvc?rev=1753222&view=rev
Log:
no Jira - make core and examples versions of SourceDocumentInformation identical (for test tooling) - only diff was javadoc comment improvement.
Modified:
uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java
uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation_Type.java
Modified: uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java?rev=1753222&r1=1753221&r2=1753222&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java (original)
+++ uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation.java Mon Jul 18 13:38:34 2016
@@ -1,224 +1,242 @@
-/*
- * 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.examples;
-
-import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.JCasRegistry;
-import org.apache.uima.jcas.cas.TOP_Type;
-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
- */
-public class SourceDocumentInformation extends Annotation {
- /**
- * @generated
- * @ordered
- */
- public final static int typeIndexID = JCasRegistry.register(SourceDocumentInformation.class);
-
- /**
- * @generated
- * @ordered
- */
- public final static int type = typeIndexID;
-
- /** @generated */
- public int getTypeIndexID() {
- return typeIndexID;
- }
-
- /**
- * Never called. Disable default constructor
- *
- * @generated
- */
- protected SourceDocumentInformation() {
- }
-
- /**
- * Internal - constructor used by generator
- *
- * @generated
- */
- public SourceDocumentInformation(int addr, TOP_Type type) {
- super(addr, type);
- readObject();
- }
-
- /** @generated */
- public SourceDocumentInformation(JCas jcas) {
- super(jcas);
- readObject();
- }
-
- /** @generated */
- 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 -->
- *
- * @generated modifiable
- */
- private void readObject() {
- }
-
- // *--------------*
- // * 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
- */
- 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.)
- *
- * @generated
- */
- 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);
- }
-
- // *--------------*
- // * 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
- */
- 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);
- }
-
- /**
- * 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
- */
- 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);
- }
-
- // *--------------*
- // * 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
- */
- 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);
- }
-
- /**
- * 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
- */
- 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);
- }
-
- // *--------------*
- // * 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
- */
- 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);
- }
-
- /**
- * 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
- */
- 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);
- }
-}
+/*
+ * 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.examples;
+
+import org.apache.uima.jcas.JCas;
+import org.apache.uima.jcas.JCasRegistry;
+import org.apache.uima.jcas.cas.TOP_Type;
+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
+ */
+public class SourceDocumentInformation extends Annotation {
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int typeIndexID = JCasRegistry.register(SourceDocumentInformation.class);
+
+ /**
+ * @generated
+ * @ordered
+ */
+ public final static int type = typeIndexID;
+
+ /** @generated */
+ public int getTypeIndexID() {
+ return typeIndexID;
+ }
+
+ /**
+ * Never called. Disable default constructor
+ *
+ * @generated
+ */
+ protected SourceDocumentInformation() {
+ }
+
+ /**
+ * Internal - constructor used by generator
+ *
+ * @param addr -
+ * @param type -
+ * @generated
+ */
+ public SourceDocumentInformation(int addr, TOP_Type type) {
+ super(addr, type);
+ readObject();
+ }
+
+ /**
+ * @generated
+ * @param jcas -
+ * */
+ 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 -->
+ *
+ * @generated modifiable
+ */
+ private void readObject() {
+ }
+
+ // *--------------*
+ // * 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
+ * @generated
+ */
+ 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);
+ }
+
+ // *--------------*
+ // * 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
+ * @generated
+ */
+ 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);
+ }
+
+ /**
+ * 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
+ * @generated
+ */
+ 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);
+ }
+
+ // *--------------*
+ // * 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
+ * @generated
+ */
+ 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);
+ }
+
+ /**
+ * 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
+ * @generated
+ */
+ 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);
+ }
+
+ // *--------------*
+ // * 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
+ * @generated
+ */
+ 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);
+ }
+
+ /**
+ * 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
+ * @generated
+ */
+ 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);
+ }
+}
Modified: uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation_Type.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation_Type.java?rev=1753222&r1=1753221&r2=1753222&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation_Type.java (original)
+++ uima/uimaj/trunk/uimaj-examples/src/main/java/org/apache/uima/examples/SourceDocumentInformation_Type.java Mon Jul 18 13:38:34 2016
@@ -1,183 +1,219 @@
-/*
- * 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.examples;
-
-import org.apache.uima.cas.Feature;
-import org.apache.uima.cas.FeatureStructure;
-import org.apache.uima.cas.Type;
-import org.apache.uima.cas.impl.CASImpl;
-import org.apache.uima.cas.impl.FSGenerator;
-import org.apache.uima.cas.impl.FeatureImpl;
-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_Type;
-
-/**
- * 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
- *
- * @generated
- */
-public class SourceDocumentInformation_Type extends Annotation_Type {
- /** @generated */
- protected FSGenerator getFSGenerator() {
- return fsGenerator;
- }
-
- /** @generated */
- private final FSGenerator fsGenerator = new FSGenerator() {
- public FeatureStructure createFS(int addr, CASImpl cas) {
- if (SourceDocumentInformation_Type.this.useExistingInstance) {
- // Return eq fs instance if already created
- FeatureStructure fs = SourceDocumentInformation_Type.this.jcas.getJfsFromCaddr(addr);
- if (null == fs) {
- fs = new SourceDocumentInformation(addr, SourceDocumentInformation_Type.this);
- SourceDocumentInformation_Type.this.jcas.putJfsFromCaddr(addr, fs);
- return fs;
- }
- return fs;
- } else
- return new SourceDocumentInformation(addr, SourceDocumentInformation_Type.this);
- }
- };
-
- /** @generated */
- public final static int typeIndexID = SourceDocumentInformation.typeIndexID;
-
- /**
- * @generated
- * @modifiable
- */
- public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.uima.examples.SourceDocumentInformation");
-
- /** @generated */
- final Feature casFeat_uri;
-
- /** @generated */
- final int casFeatCode_uri;
-
- /** @generated */
- public String getUri(int addr) {
- if (featOkTst && casFeat_uri == null)
- this.jcas.throwFeatMissing("uri", "org.apache.uima.examples.SourceDocumentInformation");
- return ll_cas.ll_getStringValue(addr, casFeatCode_uri);
- }
-
- /** @generated */
- public void setUri(int addr, String v) {
- if (featOkTst && casFeat_uri == null)
- this.jcas.throwFeatMissing("uri", "org.apache.uima.examples.SourceDocumentInformation");
- ll_cas.ll_setStringValue(addr, casFeatCode_uri, v);
- }
-
- /** @generated */
- final Feature casFeat_offsetInSource;
-
- /** @generated */
- final int casFeatCode_offsetInSource;
-
- /** @generated */
- public int getOffsetInSource(int addr) {
- if (featOkTst && casFeat_offsetInSource == null)
- this.jcas.throwFeatMissing("offsetInSource", "org.apache.uima.examples.SourceDocumentInformation");
- return ll_cas.ll_getIntValue(addr, casFeatCode_offsetInSource);
- }
-
- /** @generated */
- public void setOffsetInSource(int addr, int v) {
- if (featOkTst && casFeat_offsetInSource == null)
- this.jcas.throwFeatMissing("offsetInSource", "org.apache.uima.examples.SourceDocumentInformation");
- ll_cas.ll_setIntValue(addr, casFeatCode_offsetInSource, v);
- }
-
- /** @generated */
- final Feature casFeat_documentSize;
-
- /** @generated */
- final int casFeatCode_documentSize;
-
- /** @generated */
- public int getDocumentSize(int addr) {
- if (featOkTst && casFeat_documentSize == null)
- this.jcas.throwFeatMissing("documentSize", "org.apache.uima.examples.SourceDocumentInformation");
- return ll_cas.ll_getIntValue(addr, casFeatCode_documentSize);
- }
-
- /** @generated */
- public void setDocumentSize(int addr, int v) {
- if (featOkTst && casFeat_documentSize == null)
- this.jcas.throwFeatMissing("documentSize", "org.apache.uima.examples.SourceDocumentInformation");
- ll_cas.ll_setIntValue(addr, casFeatCode_documentSize, v);
- }
-
- /** @generated */
- final Feature casFeat_lastSegment;
-
- /** @generated */
- final int casFeatCode_lastSegment;
-
- /** @generated */
- public boolean getLastSegment(int addr) {
- if (featOkTst && casFeat_lastSegment == null)
- this.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
- return ll_cas.ll_getBooleanValue(addr, casFeatCode_lastSegment);
- }
-
- /** @generated */
- public void setLastSegment(int addr, boolean v) {
- if (featOkTst && casFeat_lastSegment == null)
- this.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
- ll_cas.ll_setBooleanValue(addr, casFeatCode_lastSegment, v);
- }
-
- /**
- * initialize variables to correspond with Cas Type and Features
- *
- * @generated
- */
- public SourceDocumentInformation_Type(JCas jcas, Type casType) {
- super(jcas, casType);
- casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
-
- casFeat_uri = jcas.getRequiredFeatureDE(casType, "uri", "uima.cas.String", featOkTst);
- casFeatCode_uri = (null == casFeat_uri) ? JCas.INVALID_FEATURE_CODE
- : ((FeatureImpl) casFeat_uri).getCode();
-
- casFeat_offsetInSource = jcas.getRequiredFeatureDE(casType, "offsetInSource",
- "uima.cas.Integer", featOkTst);
- casFeatCode_offsetInSource = (null == casFeat_offsetInSource) ? JCas.INVALID_FEATURE_CODE
- : ((FeatureImpl) casFeat_offsetInSource).getCode();
-
- casFeat_documentSize = jcas.getRequiredFeatureDE(casType, "documentSize", "uima.cas.Integer",
- featOkTst);
- casFeatCode_documentSize = (null == casFeat_documentSize) ? JCas.INVALID_FEATURE_CODE
- : ((FeatureImpl) casFeat_documentSize).getCode();
-
- casFeat_lastSegment = jcas.getRequiredFeatureDE(casType, "lastSegment", "uima.cas.Boolean",
- featOkTst);
- casFeatCode_lastSegment = (null == casFeat_lastSegment) ? JCas.INVALID_FEATURE_CODE
- : ((FeatureImpl) casFeat_lastSegment).getCode();
-
- }
-}
+/*
+ * 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.examples;
+
+import org.apache.uima.cas.Feature;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.impl.CASImpl;
+import org.apache.uima.cas.impl.FSGenerator;
+import org.apache.uima.cas.impl.FeatureImpl;
+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_Type;
+
+/**
+ * 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
+ *
+ * @generated
+ */
+public class SourceDocumentInformation_Type extends Annotation_Type {
+ /** @generated */
+ protected FSGenerator getFSGenerator() {
+ return fsGenerator;
+ }
+
+ /** @generated */
+ private final FSGenerator fsGenerator = new FSGenerator() {
+ public FeatureStructure createFS(int addr, CASImpl cas) {
+ if (SourceDocumentInformation_Type.this.useExistingInstance) {
+ // Return eq fs instance if already created
+ FeatureStructure fs = SourceDocumentInformation_Type.this.jcas.getJfsFromCaddr(addr);
+ if (null == fs) {
+ fs = new SourceDocumentInformation(addr, SourceDocumentInformation_Type.this);
+ SourceDocumentInformation_Type.this.jcas.putJfsFromCaddr(addr, fs);
+ return fs;
+ }
+ return fs;
+ } else
+ return new SourceDocumentInformation(addr, SourceDocumentInformation_Type.this);
+ }
+ };
+
+ /** @generated */
+ public final static int typeIndexID = SourceDocumentInformation.typeIndexID;
+
+ /**
+ * @generated
+ * @modifiable
+ */
+ public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.uima.examples.SourceDocumentInformation");
+
+ /** @generated */
+ final Feature casFeat_uri;
+
+ /** @generated */
+ final int casFeatCode_uri;
+
+ /**
+ * @param addr -
+ * @return the Uri
+ * @generated
+ * */
+ public String getUri(int addr) {
+ if (featOkTst && casFeat_uri == null)
+ this.jcas.throwFeatMissing("uri", "org.apache.uima.examples.SourceDocumentInformation");
+ return ll_cas.ll_getStringValue(addr, casFeatCode_uri);
+ }
+
+ /**
+ * @param addr -
+ * @param v the Uri
+ * @generated
+ * */
+ public void setUri(int addr, String v) {
+ if (featOkTst && casFeat_uri == null)
+ this.jcas.throwFeatMissing("uri", "org.apache.uima.examples.SourceDocumentInformation");
+ ll_cas.ll_setStringValue(addr, casFeatCode_uri, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_offsetInSource;
+
+ /** @generated */
+ final int casFeatCode_offsetInSource;
+
+ /**
+ * @param addr -
+ * @return -
+ * @generated
+ * */
+ public int getOffsetInSource(int addr) {
+ if (featOkTst && casFeat_offsetInSource == null)
+ this.jcas.throwFeatMissing("offsetInSource", "org.apache.uima.examples.SourceDocumentInformation");
+ return ll_cas.ll_getIntValue(addr, casFeatCode_offsetInSource);
+ }
+
+ /**
+ * @param addr -
+ * @param v -
+ * @generated
+ * */
+ public void setOffsetInSource(int addr, int v) {
+ if (featOkTst && casFeat_offsetInSource == null)
+ this.jcas.throwFeatMissing("offsetInSource", "org.apache.uima.examples.SourceDocumentInformation");
+ ll_cas.ll_setIntValue(addr, casFeatCode_offsetInSource, v);
+ }
+
+ /** @generated */
+ final Feature casFeat_documentSize;
+
+ /** @generated */
+ final int casFeatCode_documentSize;
+
+ /**
+ * @param addr -
+ * @return -
+ * @generated
+ * */
+ public int getDocumentSize(int addr) {
+ if (featOkTst && casFeat_documentSize == null)
+ this.jcas.throwFeatMissing("documentSize", "org.apache.uima.examples.SourceDocumentInformation");
+ return ll_cas.ll_getIntValue(addr, casFeatCode_documentSize);
+ }
+
+ /**
+ * @param addr -
+ * @param v the document size
+ * @generated
+ * */
+ public void setDocumentSize(int addr, int v) {
+ if (featOkTst && casFeat_documentSize == null)
+ this.jcas.throwFeatMissing("documentSize", "org.apache.uima.examples.SourceDocumentInformation");
+ ll_cas.ll_setIntValue(addr, casFeatCode_documentSize, v);
+ }
+
+ /**
+ * @generated
+ * */
+ final Feature casFeat_lastSegment;
+
+ /** @generated */
+ final int casFeatCode_lastSegment;
+
+ /**
+ * @param addr -
+ * @return true if it is last segment
+ * @generated
+ * */
+ public boolean getLastSegment(int addr) {
+ if (featOkTst && casFeat_lastSegment == null)
+ this.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
+ return ll_cas.ll_getBooleanValue(addr, casFeatCode_lastSegment);
+ }
+
+ /**
+ * @param addr -
+ * @param v true if last segment
+ * @generated
+ * */
+ public void setLastSegment(int addr, boolean v) {
+ if (featOkTst && casFeat_lastSegment == null)
+ this.jcas.throwFeatMissing("lastSegment", "org.apache.uima.examples.SourceDocumentInformation");
+ ll_cas.ll_setBooleanValue(addr, casFeatCode_lastSegment, v);
+ }
+
+ /**
+ * initialize variables to correspond with Cas Type and Features
+ *
+ * @param jcas -
+ * @param casType -
+ * @generated
+ */
+ public SourceDocumentInformation_Type(JCas jcas, Type casType) {
+ super(jcas, casType);
+ casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
+
+ casFeat_uri = jcas.getRequiredFeatureDE(casType, "uri", "uima.cas.String", featOkTst);
+ casFeatCode_uri = (null == casFeat_uri) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_uri).getCode();
+
+ casFeat_offsetInSource = jcas.getRequiredFeatureDE(casType, "offsetInSource",
+ "uima.cas.Integer", featOkTst);
+ casFeatCode_offsetInSource = (null == casFeat_offsetInSource) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_offsetInSource).getCode();
+
+ casFeat_documentSize = jcas.getRequiredFeatureDE(casType, "documentSize", "uima.cas.Integer",
+ featOkTst);
+ casFeatCode_documentSize = (null == casFeat_documentSize) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_documentSize).getCode();
+
+ casFeat_lastSegment = jcas.getRequiredFeatureDE(casType, "lastSegment", "uima.cas.Boolean",
+ featOkTst);
+ casFeatCode_lastSegment = (null == casFeat_lastSegment) ? JCas.INVALID_FEATURE_CODE
+ : ((FeatureImpl) casFeat_lastSegment).getCode();
+
+ }
+}