private List<AnnotationFS> collectLinks(FeatureStructure aChain) { List<AnnotationFS> links = new ArrayList<>(); // Now we seek the link within the current chain AnnotationFS linkFs = (AnnotationFS) aChain.getFeatureValue(aChain.getType() .getFeatureByBaseName(getChainFirstFeatureName())); while (linkFs != null) { links.add(linkFs); linkFs = getNextLink(linkFs); } return links; }
private List<AnnotationFS> collectLinks(FeatureStructure aChain) { List<AnnotationFS> links = new ArrayList<>(); // Now we seek the link within the current chain AnnotationFS linkFs = (AnnotationFS) aChain.getFeatureValue(aChain.getType() .getFeatureByBaseName(getChainFirstFeatureName())); while (linkFs != null) { links.add(linkFs); linkFs = getNextLink(linkFs); } return links; }
/** * 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(getChainFirstFeatureName()), aLink); }
/** * 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( getChainFirstFeatureName())); }
/** * 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(getChainFirstFeatureName()), aLink); }
/** * 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( getChainFirstFeatureName())); }
/** * Create a new chain head feature structure. Already adds the chain to the CAS. */ private FeatureStructure newChain(JCas aJCas, AnnotationFS aFirstLink) { Type chainType = CasUtil.getType(aJCas.getCas(), getChainTypeName()); FeatureStructure newChain = aJCas.getCas().createFS(chainType); newChain.setFeatureValue(chainType.getFeatureByBaseName(getChainFirstFeatureName()), aFirstLink); aJCas.addFsToIndexes(newChain); return newChain; }
/** * Create a new chain head feature structure. Already adds the chain to the CAS. */ private FeatureStructure newChain(JCas aJCas, AnnotationFS aFirstLink) { Type chainType = CasUtil.getType(aJCas.getCas(), getChainTypeName()); FeatureStructure newChain = aJCas.getCas().createFS(chainType); newChain.setFeatureValue(chainType.getFeatureByBaseName(getChainFirstFeatureName()), aFirstLink); aJCas.addFsToIndexes(newChain); return newChain; }
Feature chainFirst = chainType.getFeatureByBaseName(typeAdapter.getChainFirstFeatureName());
Feature chainFirst = chainType.getFeatureByBaseName(typeAdapter.getChainFirstFeatureName());