001 002/* First created by JCasGen Wed May 07 09:15:21 EDT 2014 */ 003package org.cleartk.ne.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; 014import org.cleartk.score.type.ScoredAnnotation_Type; 015 016/** 017 * Updated by JCasGen Wed May 07 09:15:21 EDT 2014 018 * @generated */ 019public class NamedEntityMention_Type extends ScoredAnnotation_Type { 020 /** @generated 021 * @return the generator for this type 022 */ 023 @Override 024 protected FSGenerator getFSGenerator() {return fsGenerator;} 025 /** @generated */ 026 private final FSGenerator fsGenerator = 027 new FSGenerator() { 028 public FeatureStructure createFS(int addr, CASImpl cas) { 029 if (NamedEntityMention_Type.this.useExistingInstance) { 030 // Return eq fs instance if already created 031 FeatureStructure fs = NamedEntityMention_Type.this.jcas.getJfsFromCaddr(addr); 032 if (null == fs) { 033 fs = new NamedEntityMention(addr, NamedEntityMention_Type.this); 034 NamedEntityMention_Type.this.jcas.putJfsFromCaddr(addr, fs); 035 return fs; 036 } 037 return fs; 038 } else return new NamedEntityMention(addr, NamedEntityMention_Type.this); 039 } 040 }; 041 /** @generated */ 042 @SuppressWarnings ("hiding") 043 public final static int typeIndexID = NamedEntityMention.typeIndexID; 044 /** @generated 045 @modifiable */ 046 @SuppressWarnings ("hiding") 047 public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.cleartk.ne.type.NamedEntityMention"); 048 049 /** @generated */ 050 final Feature casFeat_mentionType; 051 /** @generated */ 052 final int casFeatCode_mentionType; 053 /** @generated 054 * @param addr low level Feature Structure reference 055 * @return the feature value 056 */ 057 public String getMentionType(int addr) { 058 if (featOkTst && casFeat_mentionType == null) 059 jcas.throwFeatMissing("mentionType", "org.cleartk.ne.type.NamedEntityMention"); 060 return ll_cas.ll_getStringValue(addr, casFeatCode_mentionType); 061 } 062 /** @generated 063 * @param addr low level Feature Structure reference 064 * @param v value to set 065 */ 066 public void setMentionType(int addr, String v) { 067 if (featOkTst && casFeat_mentionType == null) 068 jcas.throwFeatMissing("mentionType", "org.cleartk.ne.type.NamedEntityMention"); 069 ll_cas.ll_setStringValue(addr, casFeatCode_mentionType, v);} 070 071 072 073 /** @generated */ 074 final Feature casFeat_mentionedEntity; 075 /** @generated */ 076 final int casFeatCode_mentionedEntity; 077 /** @generated 078 * @param addr low level Feature Structure reference 079 * @return the feature value 080 */ 081 public int getMentionedEntity(int addr) { 082 if (featOkTst && casFeat_mentionedEntity == null) 083 jcas.throwFeatMissing("mentionedEntity", "org.cleartk.ne.type.NamedEntityMention"); 084 return ll_cas.ll_getRefValue(addr, casFeatCode_mentionedEntity); 085 } 086 /** @generated 087 * @param addr low level Feature Structure reference 088 * @param v value to set 089 */ 090 public void setMentionedEntity(int addr, int v) { 091 if (featOkTst && casFeat_mentionedEntity == null) 092 jcas.throwFeatMissing("mentionedEntity", "org.cleartk.ne.type.NamedEntityMention"); 093 ll_cas.ll_setRefValue(addr, casFeatCode_mentionedEntity, v);} 094 095 096 097 /** @generated */ 098 final Feature casFeat_annotation; 099 /** @generated */ 100 final int casFeatCode_annotation; 101 /** @generated 102 * @param addr low level Feature Structure reference 103 * @return the feature value 104 */ 105 public int getAnnotation(int addr) { 106 if (featOkTst && casFeat_annotation == null) 107 jcas.throwFeatMissing("annotation", "org.cleartk.ne.type.NamedEntityMention"); 108 return ll_cas.ll_getRefValue(addr, casFeatCode_annotation); 109 } 110 /** @generated 111 * @param addr low level Feature Structure reference 112 * @param v value to set 113 */ 114 public void setAnnotation(int addr, int v) { 115 if (featOkTst && casFeat_annotation == null) 116 jcas.throwFeatMissing("annotation", "org.cleartk.ne.type.NamedEntityMention"); 117 ll_cas.ll_setRefValue(addr, casFeatCode_annotation, v);} 118 119 120 121 /** @generated */ 122 final Feature casFeat_head; 123 /** @generated */ 124 final int casFeatCode_head; 125 /** @generated 126 * @param addr low level Feature Structure reference 127 * @return the feature value 128 */ 129 public int getHead(int addr) { 130 if (featOkTst && casFeat_head == null) 131 jcas.throwFeatMissing("head", "org.cleartk.ne.type.NamedEntityMention"); 132 return ll_cas.ll_getRefValue(addr, casFeatCode_head); 133 } 134 /** @generated 135 * @param addr low level Feature Structure reference 136 * @param v value to set 137 */ 138 public void setHead(int addr, int v) { 139 if (featOkTst && casFeat_head == null) 140 jcas.throwFeatMissing("head", "org.cleartk.ne.type.NamedEntityMention"); 141 ll_cas.ll_setRefValue(addr, casFeatCode_head, v);} 142 143 144 145 /** @generated */ 146 final Feature casFeat_mentionId; 147 /** @generated */ 148 final int casFeatCode_mentionId; 149 /** @generated 150 * @param addr low level Feature Structure reference 151 * @return the feature value 152 */ 153 public String getMentionId(int addr) { 154 if (featOkTst && casFeat_mentionId == null) 155 jcas.throwFeatMissing("mentionId", "org.cleartk.ne.type.NamedEntityMention"); 156 return ll_cas.ll_getStringValue(addr, casFeatCode_mentionId); 157 } 158 /** @generated 159 * @param addr low level Feature Structure reference 160 * @param v value to set 161 */ 162 public void setMentionId(int addr, String v) { 163 if (featOkTst && casFeat_mentionId == null) 164 jcas.throwFeatMissing("mentionId", "org.cleartk.ne.type.NamedEntityMention"); 165 ll_cas.ll_setStringValue(addr, casFeatCode_mentionId, v);} 166 167 168 169 170 171 /** initialize variables to correspond with Cas Type and Features 172 * @generated 173 * @param jcas JCas 174 * @param casType Type 175 */ 176 public NamedEntityMention_Type(JCas jcas, Type casType) { 177 super(jcas, casType); 178 casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); 179 180 181 casFeat_mentionType = jcas.getRequiredFeatureDE(casType, "mentionType", "uima.cas.String", featOkTst); 182 casFeatCode_mentionType = (null == casFeat_mentionType) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_mentionType).getCode(); 183 184 185 casFeat_mentionedEntity = jcas.getRequiredFeatureDE(casType, "mentionedEntity", "org.cleartk.ne.type.NamedEntity", featOkTst); 186 casFeatCode_mentionedEntity = (null == casFeat_mentionedEntity) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_mentionedEntity).getCode(); 187 188 189 casFeat_annotation = jcas.getRequiredFeatureDE(casType, "annotation", "uima.tcas.Annotation", featOkTst); 190 casFeatCode_annotation = (null == casFeat_annotation) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_annotation).getCode(); 191 192 193 casFeat_head = jcas.getRequiredFeatureDE(casType, "head", "uima.tcas.Annotation", featOkTst); 194 casFeatCode_head = (null == casFeat_head) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_head).getCode(); 195 196 197 casFeat_mentionId = jcas.getRequiredFeatureDE(casType, "mentionId", "uima.cas.String", featOkTst); 198 casFeatCode_mentionId = (null == casFeat_mentionId) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_mentionId).getCode(); 199 200 } 201} 202 203 204 205