001 002 003/* First created by JCasGen Wed May 07 09:15:21 EDT 2014 */ 004package org.cleartk.syntax.dependency.type; 005 006import org.apache.uima.jcas.JCas; 007import org.apache.uima.jcas.JCasRegistry; 008import org.apache.uima.jcas.cas.TOP_Type; 009 010import org.cleartk.score.type.ScoredTOP; 011 012 013/** 014 * Updated by JCasGen Wed May 07 09:15:21 EDT 2014 015 * XML source: /Users/bethard/Code/cleartk/target/checkout/cleartk-type-system/target/jcasgen/typesystem.xml 016 * @generated */ 017public class DependencyRelation extends ScoredTOP { 018 /** @generated 019 * @ordered 020 */ 021 @SuppressWarnings ("hiding") 022 public final static int typeIndexID = JCasRegistry.register(DependencyRelation.class); 023 /** @generated 024 * @ordered 025 */ 026 @SuppressWarnings ("hiding") 027 public final static int type = typeIndexID; 028 /** @generated 029 * @return index of the type 030 */ 031 @Override 032 public int getTypeIndexID() {return typeIndexID;} 033 034 /** Never called. Disable default constructor 035 * @generated */ 036 protected DependencyRelation() {/* intentionally empty block */} 037 038 /** Internal - constructor used by generator 039 * @generated 040 * @param addr low level Feature Structure reference 041 * @param type the type of this Feature Structure 042 */ 043 public DependencyRelation(int addr, TOP_Type type) { 044 super(addr, type); 045 readObject(); 046 } 047 048 /** @generated 049 * @param jcas JCas to which this Feature Structure belongs 050 */ 051 public DependencyRelation(JCas jcas) { 052 super(jcas); 053 readObject(); 054 } 055 056 /** 057 * <!-- begin-user-doc --> 058 * Write your own initialization here 059 * <!-- end-user-doc --> 060 * 061 * @generated modifiable 062 */ 063 private void readObject() {/*default - does nothing empty block */} 064 065 066 067 //*--------------* 068 //* Feature: Head 069 070 /** getter for Head - gets 071 * @generated 072 * @return value of the feature 073 */ 074 public DependencyNode getHead() { 075 if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_Head == null) 076 jcasType.jcas.throwFeatMissing("Head", "org.cleartk.syntax.dependency.type.DependencyRelation"); 077 return (DependencyNode)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_Head)));} 078 079 /** setter for Head - sets 080 * @generated 081 * @param v value to set into the feature 082 */ 083 public void setHead(DependencyNode v) { 084 if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_Head == null) 085 jcasType.jcas.throwFeatMissing("Head", "org.cleartk.syntax.dependency.type.DependencyRelation"); 086 jcasType.ll_cas.ll_setRefValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_Head, jcasType.ll_cas.ll_getFSRef(v));} 087 088 089 //*--------------* 090 //* Feature: Relation 091 092 /** getter for Relation - gets 093 * @generated 094 * @return value of the feature 095 */ 096 public String getRelation() { 097 if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_Relation == null) 098 jcasType.jcas.throwFeatMissing("Relation", "org.cleartk.syntax.dependency.type.DependencyRelation"); 099 return jcasType.ll_cas.ll_getStringValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_Relation);} 100 101 /** setter for Relation - sets 102 * @generated 103 * @param v value to set into the feature 104 */ 105 public void setRelation(String v) { 106 if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_Relation == null) 107 jcasType.jcas.throwFeatMissing("Relation", "org.cleartk.syntax.dependency.type.DependencyRelation"); 108 jcasType.ll_cas.ll_setStringValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_Relation, v);} 109 110 111 //*--------------* 112 //* Feature: Child 113 114 /** getter for Child - gets 115 * @generated 116 * @return value of the feature 117 */ 118 public DependencyNode getChild() { 119 if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_Child == null) 120 jcasType.jcas.throwFeatMissing("Child", "org.cleartk.syntax.dependency.type.DependencyRelation"); 121 return (DependencyNode)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_Child)));} 122 123 /** setter for Child - sets 124 * @generated 125 * @param v value to set into the feature 126 */ 127 public void setChild(DependencyNode v) { 128 if (DependencyRelation_Type.featOkTst && ((DependencyRelation_Type)jcasType).casFeat_Child == null) 129 jcasType.jcas.throwFeatMissing("Child", "org.cleartk.syntax.dependency.type.DependencyRelation"); 130 jcasType.ll_cas.ll_setRefValue(addr, ((DependencyRelation_Type)jcasType).casFeatCode_Child, jcasType.ll_cas.ll_getFSRef(v));} 131 } 132 133