You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2015/11/09 20:40:33 UTC
svn commit: r1713520 -
/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/OutOfTypeSystemData.java
Author: schor
Date: Mon Nov 9 19:40:33 2015
New Revision: 1713520
URL: http://svn.apache.org/viewvc?rev=1713520&view=rev
Log:
[UIMA-4663] update XCAS OutOfTypeSystemData object to use Java object representation
Modified:
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/OutOfTypeSystemData.java
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/OutOfTypeSystemData.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/OutOfTypeSystemData.java?rev=1713520&r1=1713519&r2=1713520&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/OutOfTypeSystemData.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/OutOfTypeSystemData.java Mon Nov 9 19:40:33 2015
@@ -21,10 +21,13 @@ package org.apache.uima.cas.impl;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.uima.jcas.cas.TOP;
+
/**
* This class is used by the XCASDeserializer to store feature structures that do not fit into the
* type system of the CAS it is deserializing into. This data can then be passed to the
@@ -40,13 +43,13 @@ public class OutOfTypeSystemData {
List<FSData> fsList = new ArrayList<FSData>();
/**
- * Map from Integer (CAS address) to List of String arrays holding feature names and values for
+ * Map from Feature Structure to List of String arrays holding feature names and values for
* out-of-typesystem features on in-typesystem FSs.
*/
- Map<Integer, List<String[]>> extraFeatureValues = new HashMap<Integer, List<String[]>>();
+ Map<TOP, List<String[]>> extraFeatureValues = new IdentityHashMap<TOP, List<String[]>>();
/**
- * Map from Integer (CAS address of an FSArray) to List of ArrayElement objects, each of which
+ * Map from FSArray instances to List of ArrayElement objects, each of which
* holds an array index and value (as a string).
*/
Map<Integer, List<ArrayElement>> arrayElements = new HashMap<Integer, List<ArrayElement>>();
@@ -68,9 +71,9 @@ public class OutOfTypeSystemData {
buf.append(fs.toString()).append('\n');
}
buf.append("\nFeatures\n-----------------\n");
- for (Map.Entry<Integer, List<String[]>> entry : extraFeatureValues.entrySet()) {
- Integer id = entry.getKey();
- buf.append(id).append(": ");
+ for (Map.Entry<TOP, List<String[]>> entry : extraFeatureValues.entrySet()) {
+ TOP id = entry.getKey();
+ buf.append(id._id).append(": ");
for (String[] attr : entry.getValue()) {
buf.append(attr[0]).append('=').append(attr[1]).append('\n');
}