public class CasCopier
extends java.lang.Object
Constructor and Description |
---|
CasCopier(CAS aSrcCas,
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(FeatureStructure aFS) |
static void |
copyCas(CAS aSrcCas,
CAS aDestCas,
boolean aCopySofa)
Does a complete deep copy of one CAS into another CAS.
|
void |
copyCasView(CAS aSrcCasView,
boolean aCopySofa)
Does a deep copy of the contents of one CAS View into another CAS.
|
FeatureStructure |
copyFs(FeatureStructure aFS)
For long lists, and other structures, the straight-forward impl with recursion can
nest too deep, causing a Java failure - out of stack space.
|
FeatureStructure |
copyFsInner(FeatureStructure aFS)
Copies an FS from the source CAS to the destination CAS.
|
public CasCopier(CAS aSrcCas, CAS aDestCas)
aSrcCas
- the CAS to copy from.aDestCas
- the CAS to copy into.public static void copyCas(CAS aSrcCas, 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(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 FeatureStructure copyFs(FeatureStructure aFS)
public FeatureStructure copyFsInner(FeatureStructure aFS)
aFS
- the FS to copy. Must be contained within the source CAS.aFS
in the target CAS.public boolean alreadyCopied(FeatureStructure aFS)
aFS
- a feature structureCopyright © 2012. All Rights Reserved.