You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2012/05/24 15:21:03 UTC

svn commit: r1342246 - /uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java

Author: joern
Date: Thu May 24 13:21:02 2012
New Revision: 1342246

URL: http://svn.apache.org/viewvc?rev=1342246&view=rev
Log:
 UIMA-2409 Added new copyCasView method where the destination view name can be specified.

Modified:
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java?rev=1342246&r1=1342245&r2=1342246&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java Thu May 24 13:21:02 2012
@@ -111,19 +111,21 @@ public class CasCopier {
 
   /**
    * Does a deep copy of the contents of one CAS View into another CAS.
-   * If a view with the same name as <code>aSrcCasView</code> exists in the destination CAS,
+   * If a view with the same name as <code>aDestCasView</code> 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.
    * 
    * @param aSrcCasView
    *          the CAS to copy from
+   * @param aDestCasView
+   *          the destination CAS view
    * @param aCopySofa
    *          if true, the sofa data and mimeType will be copied. If false they will not.
    */
-  public void copyCasView(CAS aSrcCasView, boolean aCopySofa) {
+  public void copyCasView(CAS aSrcCasView, String aDestCasView, boolean aCopySofa) {
     //get or create the target view
-    CAS targetView = getOrCreateView(mDestCas, aSrcCasView.getViewName());
+    CAS targetView = getOrCreateView(mDestCas, aDestCasView);
     
     if (aCopySofa) {
       // can't copy the SofaFS - just copy the sofa data and mime type
@@ -168,6 +170,22 @@ public class CasCopier {
   }
 
   /**
+   * Does a deep copy of the contents of one CAS View into another CAS.
+   * If a view with the same name as <code>aSrcCasView</code> 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.
+   * 
+   * @param aSrcCasView
+   *          the CAS to copy from
+   * @param aCopySofa
+   *          if true, the sofa data and mimeType will be copied. If false they will not.
+   */
+  public void copyCasView(CAS aSrcCasView, boolean aCopySofa) {
+    copyCasView(aSrcCasView, aSrcCasView.getViewName(), aCopySofa);
+  }
+  
+  /**
    * For long lists, and other structures, the straight-forward impl with recursion can
    * nest too deep, causing a Java failure - out of stack space.
    *