public class CasCopier extends 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.
|
CasCopier(CAS aSrcCas,
CAS aDestCas,
boolean lenient)
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)
Note: if lenient is in effect, this method will return false for
FSs which are not copied because the target doesn't have that type.
|
boolean |
alreadyCopied(int aFS)
Note: if lenient is in effect, this method will return false for
FSs which are not copied because the target doesn't have that type.
|
static void |
copyCas(CAS aSrcCas,
CAS aDestCas,
boolean aCopySofa)
Does a complete deep copy of one CAS into another CAS.
|
static void |
copyCas(CAS aSrcCas,
CAS aDestCas,
boolean aCopySofa,
boolean lenient)
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's same-named-view
If the destination view already exists in the destination CAS,
then it will be the target of the copy.
|
void |
copyCasView(CAS aSrcCasView,
CAS aTgtCasView,
boolean aCopySofa)
Does a deep copy of the contents of one CAS View into another CAS view,
with a possibly different name.
|
void |
copyCasView(CAS aSrcCasView,
String aTgtCasViewName,
boolean aCopySofa)
Does a deep copy of the contents of one CAS View into another CAS view,
with a possibly different name.
|
void |
copyCasView(String aSrcCasViewName,
boolean aCopySofa)
Does a deep copy of the contents of one CAS View into another CAS's same-named-view
If the destination view already exists in the destination CAS,
then it will be the target of the copy.
|
void |
copyCasView(String aSrcCasViewName,
CAS aTgtCasView,
boolean aCopySofa)
Does a deep copy of the contents of one CAS View into another CAS view,
with a possibly different name.
|
FeatureStructure |
copyFs(FeatureStructure aFS)
Copy 1 feature structure from the originalSrcCas to a new Cas.
|
public CasCopier(CAS aSrcCas, CAS aDestCas)
aSrcCas
- the CAS to copy from.aDestCas
- the CAS to copy into.public CasCopier(CAS aSrcCas, CAS aDestCas, boolean lenient)
aSrcCas
- the CAS to copy from.aDestCas
- the CAS to copy into.lenient
- ignore FSs and features not defined in the type system of the destination CASpublic 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 static void copyCas(CAS aSrcCas, CAS aDestCas, boolean aCopySofa, boolean lenient)
aSrcCas
- the CAS to copy fromaDestCas
- the CAS to copy to; must be a completely different CAS than the source (that is, not an alternative "view" of the source)aCopySofa
- if true, the sofa data and mimeType of each view will be copied. If false they will not.lenient
- ignore FSs and features not defined in the type system of the destination CASpublic void copyCasView(CAS aSrcCasView, boolean aCopySofa)
aSrcCasView
- the CAS to copy from. This must be a view in the src Cas set by the constructoraCopySofa
- if true, the sofa data and mimeType will be copied. If false they will not.public void copyCasView(String aSrcCasViewName, boolean aCopySofa)
aSrcCasViewName
- the name of the view in the source CAS to copy fromaCopySofa
- if true, the sofa data and mimeType will be copied. If false they will not.public void copyCasView(CAS aSrcCasView, String aTgtCasViewName, boolean aCopySofa)
aSrcCasView
- The view in the source to copy fromaTgtCasViewName
- The name of the view in the destination CAS to copy intoaCopySofa
- if true, the sofa data and mimeType will be copied. If false they will not.public void copyCasView(String aSrcCasViewName, CAS aTgtCasView, boolean aCopySofa)
aSrcCasViewName
- The name of the view in the Source CAS to copy fromaTgtCasView
- The view in the destination CAS to copy intoaCopySofa
- if true, the sofa data and mimeType will be copied. If false they will not.public void copyCasView(CAS aSrcCasView, CAS aTgtCasView, boolean aCopySofa)
aSrcCasView
- the CAS view to copy from. This must be a view of the srcCas set in the constructoraTgtCasView
- the CAS view to copy to. This must be a view of the tgtCas set in the constructoraCopySofa
- if true, the sofa data and mimeType will be copied. If false they will not.
If true and the sofa data is already set in the target, will throw CASRuntimeExceptionpublic FeatureStructure copyFs(FeatureStructure aFS)
aFS
- the Feature Structure to copypublic boolean alreadyCopied(FeatureStructure aFS)
aFS
- a feature structurepublic boolean alreadyCopied(int aFS)
aFS
- a feature structureCopyright © 2006–2017 The Apache Software Foundation. All rights reserved.