/* First created by JCasGen Sat May 07 22:33:38 JST 2011 */
package org.apache.solr.uima.ts;
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;
/**
* Updated by JCasGen Sat May 07 22:33:38 JST 2011
* @generated */
public class EntityAnnotation_Type extends Annotation_Type {
/** @generated */
@Override
protected FSGenerator getFSGenerator() {return fsGenerator;}
/** @generated */
private final FSGenerator fsGenerator =
new FSGenerator() {
@Override
public FeatureStructure createFS(int addr, CASImpl cas) {
if (EntityAnnotation_Type.this.useExistingInstance) {
// Return eq fs instance if already created
FeatureStructure fs = EntityAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
if (null == fs) {
fs = new EntityAnnotation(addr, EntityAnnotation_Type.this);
EntityAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
return fs;
}
return fs;
} else return new EntityAnnotation(addr, EntityAnnotation_Type.this);
}
};
/** @generated */
public final static int typeIndexID = EntityAnnotation.typeIndexID;
/** @generated
@modifiable */
public final static boolean featOkTst = JCasRegistry.getFeatOkTst("org.apache.solr.uima.ts.EntityAnnotation");
/** @generated */
final Feature casFeat_name;
/** @generated */
final int casFeatCode_name;
/** @generated */
public String getName(int addr) {
if (featOkTst && casFeat_name == null)
jcas.throwFeatMissing("name", "org.apache.solr.uima.ts.EntityAnnotation");
return ll_cas.ll_getStringValue(addr, casFeatCode_name);
}
/** @generated */
public void setName(int addr, String v) {
if (featOkTst && casFeat_name == null)
jcas.throwFeatMissing("name", "org.apache.solr.uima.ts.EntityAnnotation");
ll_cas.ll_setStringValue(addr, casFeatCode_name, v);}
/** @generated */
final Feature casFeat_entity;
/** @generated */
final int casFeatCode_entity;
/** @generated */
public String getEntity(int addr) {
if (featOkTst && casFeat_entity == null)
jcas.throwFeatMissing("entity", "org.apache.solr.uima.ts.EntityAnnotation");
return ll_cas.ll_getStringValue(addr, casFeatCode_entity);
}
/** @generated */
public void setEntity(int addr, String v) {
if (featOkTst && casFeat_entity == null)
jcas.throwFeatMissing("entity", "org.apache.solr.uima.ts.EntityAnnotation");
ll_cas.ll_setStringValue(addr, casFeatCode_entity, v);}
/** initialize variables to correspond with Cas Type and Features
* @generated */
public EntityAnnotation_Type(JCas jcas, Type casType) {
super(jcas, casType);
casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());
casFeat_name = jcas.getRequiredFeatureDE(casType, "name", "uima.cas.String", featOkTst);
casFeatCode_name = (null == casFeat_name) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_name).getCode();
casFeat_entity = jcas.getRequiredFeatureDE(casType, "entity", "uima.cas.String", featOkTst);
casFeatCode_entity = (null == casFeat_entity) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_entity).getCode();
}
}