001
002/* First created by JCasGen Wed May 07 09:15:21 EDT 2014 */
003package org.cleartk.syntax.constituent.type;
004
005import org.apache.uima.jcas.JCas;
006import org.apache.uima.jcas.JCasRegistry;
007import org.apache.uima.cas.impl.CASImpl;
008import org.apache.uima.cas.impl.FSGenerator;
009import org.apache.uima.cas.FeatureStructure;
010import org.apache.uima.cas.impl.TypeImpl;
011import org.apache.uima.cas.Type;
012import org.apache.uima.cas.impl.FeatureImpl;
013import org.apache.uima.cas.Feature;
014
015/** 
016 * Updated by JCasGen Wed May 07 09:15:21 EDT 2014
017 * @generated */
018public class TerminalTreebankNode_Type extends TreebankNode_Type {
019  /** @generated 
020   * @return the generator for this type
021   */
022  @Override
023  protected FSGenerator getFSGenerator() {return fsGenerator;}
024  /** @generated */
025  private final FSGenerator fsGenerator = 
026    new FSGenerator() {
027      public FeatureStructure createFS(int addr, CASImpl cas) {
028                         if (TerminalTreebankNode_Type.this.useExistingInstance) {
029                           // Return eq fs instance if already created
030                     FeatureStructure fs = TerminalTreebankNode_Type.this.jcas.getJfsFromCaddr(addr);
031                     if (null == fs) {
032                       fs = new TerminalTreebankNode(addr, TerminalTreebankNode_Type.this);
033                           TerminalTreebankNode_Type.this.jcas.putJfsFromCaddr(addr, fs);
034                           return fs;
035                     }
036                     return fs;
037        } else return new TerminalTreebankNode(addr, TerminalTreebankNode_Type.this);
038          }
039    };
040  /** @generated */
041  @SuppressWarnings ("hiding")
042  public final static int typeIndexID = TerminalTreebankNode.typeIndexID;
043  /** @generated 
044     @modifiable */
045  @SuppressWarnings ("hiding")
046  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.cleartk.syntax.constituent.type.TerminalTreebankNode");
047 
048  /** @generated */
049  final Feature casFeat_index;
050  /** @generated */
051  final int     casFeatCode_index;
052  /** @generated
053   * @param addr low level Feature Structure reference
054   * @return the feature value 
055   */ 
056  public int getIndex(int addr) {
057        if (featOkTst && casFeat_index == null)
058      jcas.throwFeatMissing("index", "org.cleartk.syntax.constituent.type.TerminalTreebankNode");
059    return ll_cas.ll_getIntValue(addr, casFeatCode_index);
060  }
061  /** @generated
062   * @param addr low level Feature Structure reference
063   * @param v value to set 
064   */    
065  public void setIndex(int addr, int v) {
066        if (featOkTst && casFeat_index == null)
067      jcas.throwFeatMissing("index", "org.cleartk.syntax.constituent.type.TerminalTreebankNode");
068    ll_cas.ll_setIntValue(addr, casFeatCode_index, v);}
069    
070  
071 
072  /** @generated */
073  final Feature casFeat_tokenIndex;
074  /** @generated */
075  final int     casFeatCode_tokenIndex;
076  /** @generated
077   * @param addr low level Feature Structure reference
078   * @return the feature value 
079   */ 
080  public int getTokenIndex(int addr) {
081        if (featOkTst && casFeat_tokenIndex == null)
082      jcas.throwFeatMissing("tokenIndex", "org.cleartk.syntax.constituent.type.TerminalTreebankNode");
083    return ll_cas.ll_getIntValue(addr, casFeatCode_tokenIndex);
084  }
085  /** @generated
086   * @param addr low level Feature Structure reference
087   * @param v value to set 
088   */    
089  public void setTokenIndex(int addr, int v) {
090        if (featOkTst && casFeat_tokenIndex == null)
091      jcas.throwFeatMissing("tokenIndex", "org.cleartk.syntax.constituent.type.TerminalTreebankNode");
092    ll_cas.ll_setIntValue(addr, casFeatCode_tokenIndex, v);}
093    
094  
095
096
097
098  /** initialize variables to correspond with Cas Type and Features
099         * @generated
100         * @param jcas JCas
101         * @param casType Type 
102         */
103  public TerminalTreebankNode_Type(JCas jcas, Type casType) {
104    super(jcas, casType);
105    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
106
107 
108    casFeat_index = jcas.getRequiredFeatureDE(casType, "index", "uima.cas.Integer", featOkTst);
109    casFeatCode_index  = (null == casFeat_index) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_index).getCode();
110
111 
112    casFeat_tokenIndex = jcas.getRequiredFeatureDE(casType, "tokenIndex", "uima.cas.Integer", featOkTst);
113    casFeatCode_tokenIndex  = (null == casFeat_tokenIndex) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_tokenIndex).getCode();
114
115  }
116}
117
118
119
120