@Override public boolean match(FeatureStructure ref, FeatureStructure cand) { if (!subtypeMatch) { return ref.getType().equals(cand.getType()); } else { TypeSystem ts = ref.getCAS().getTypeSystem(); return ts.subsumes(ref.getType(), cand.getType()); } }
private List<AnnotationFS> collectLinks(FeatureStructure aChain) { List<AnnotationFS> links = new ArrayList<AnnotationFS>(); // Now we seek the link within the current chain AnnotationFS linkFs = (AnnotationFS) aChain.getFeatureValue(aChain.getType().getFeatureByBaseName(chainFirstFeatureName)); while (linkFs != null) { links.add(linkFs); linkFs = getNextLink(linkFs); } return links; }
/** Get the first link of a chain from the chain head feature structure. */ private AnnotationFS getFirstLink(FeatureStructure aChain) { return (AnnotationFS) aChain.getFeatureValue(aChain.getType().getFeatureByBaseName(chainFirstFeatureName)); }
/** Set the first link of a chain in the chain head feature structure. */ private void setFirstLink(FeatureStructure aChain, AnnotationFS aLink) { aChain.setFeatureValue(aChain.getType().getFeatureByBaseName(chainFirstFeatureName), aLink); }