public class CasCopier extends Object
Constructor and Description |
---|
CasCopier(org.apache.uima.cas.CAS aSrcCas,
org.apache.uima.cas.CAS aDestCas)
Creates a new CasCopier that can be used to copy FeatureStructures from one CAS to another.
|
Modifier and Type | Method and Description |
---|---|
boolean |
alreadyCopied(org.apache.uima.cas.FeatureStructure aFS)
Returns whether the given FS has already been copied using this CasCopier.
|
List<org.apache.uima.jcas.tcas.Annotation> |
batchCopyAnnotations(List<org.apache.uima.jcas.tcas.Annotation> annoList)
Performs batch-copying of Annotations (could also be generalized to FeatureStructures)
While copying the annotations, the whole batch is held in a class attribute.
|
static void |
copyCas(org.apache.uima.cas.CAS aSrcCas,
org.apache.uima.cas.CAS aDestCas,
boolean aCopySofa)
Does a complete deep copy of one CAS into another CAS.
|
void |
copyCasView(org.apache.uima.cas.CAS aSrcCasView,
boolean aCopySofa)
Does a deep copy of the contents of one CAS View into another CAS.
|
org.apache.uima.cas.FeatureStructure |
copyFs(org.apache.uima.cas.FeatureStructure aFS)
Copies an FS from the source CAS to the destination CAS.
|
public CasCopier(org.apache.uima.cas.CAS aSrcCas, org.apache.uima.cas.CAS aDestCas)
aSrcCas
- the CAS to copy from.aDestCas
- the CAS to copy into.public static void copyCas(org.apache.uima.cas.CAS aSrcCas, org.apache.uima.cas.CAS aDestCas, boolean aCopySofa)
aSrcCas
- the CAS to copy fromaDestCas
- the CAS to copy toaCopySofa
- if true, the sofa data and mimeType of each view will be copied. If false they
will not.public void copyCasView(org.apache.uima.cas.CAS aSrcCasView, boolean aCopySofa)
aSrcCasView
exists in the destination CAS, then it will be the target of
the copy. Otherwise, a new view will be created with that name and will become the target of
the copy. All FeatureStructures that are indexed in the source CAS view will become indexed
in the target view.aSrcCasView
- the CAS to copy fromaCopySofa
- if true, the sofa data and mimeType will be copied. If false they will not.public org.apache.uima.cas.FeatureStructure copyFs(org.apache.uima.cas.FeatureStructure aFS)
aFS
- the FS to copy. Must be contained within the source CAS.aFS
in the target CAS.public boolean alreadyCopied(org.apache.uima.cas.FeatureStructure aFS)
aFS
- a feature structure.public List<org.apache.uima.jcas.tcas.Annotation> batchCopyAnnotations(List<org.apache.uima.jcas.tcas.Annotation> annoList)
annoList
- the list of annotations that is to be batch-copiedCopyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.