|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.util.CasCopier
public class CasCopier
Utility class for doing deep copies of FeatureStructures from one CAS to another. To handle cases where the source CAS has multiple references to the same FS, you can create one instance of CasCopier and use it to copy multiple FeatureStructures. The CasCopier will remember previously copied FeatureStructures, so if you later copy another FS that has a reference to a previously copied FS, it will not duplicate the multiply-referenced FS.
Constructor Summary | |
---|---|
CasCopier(CAS aSrcCas,
CAS aDestCas)
Creates a new CasCopier that can be used to copy FeatureStructures from one CAS to another. |
Method Summary | |
---|---|
boolean |
alreadyCopied(FeatureStructure aFS)
Returns whether the given FS has already been copied using this CasCopier. |
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)
Copies an FS from the source CAS to the destination CAS. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CasCopier(CAS aSrcCas, CAS aDestCas)
aSrcCas
- the CAS to copy from.aDestCas
- the CAS to copy into.Method Detail |
---|
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)
aFS
- the FS to copy. Must be contained within the source CAS.
aFS
in the target CAS.public boolean alreadyCopied(FeatureStructure aFS)
aFS
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |