You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2014/03/05 02:57:34 UTC
[08/14] git commit: Removed one more array of tracking data.
Removed one more array of tracking data.
Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/0383734d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/0383734d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/0383734d
Branch: refs/heads/prestonc/parser
Commit: 0383734d4a303166279453007042fb793e2850ea
Parents: 7336f47
Author: Preston Carman <pr...@apache.org>
Authored: Sun Feb 16 21:45:40 2014 -0800
Committer: Preston Carman <pr...@apache.org>
Committed: Thu Feb 27 14:22:24 2014 -0800
----------------------------------------------------------------------
.../vxquery/xmlparser/SAXContentHandler.java | 39 ++++++++++----------
1 file changed, 19 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/0383734d/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
index 3ead13a..40a35b0 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java
@@ -70,10 +70,10 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
// Structure and data.
private final GrowableIntArray leavesKind;
- private final GrowableIntArray leavesStart;
+// private final GrowableIntArray leavesStart;
private final GrowableIntArray leavesEnd;
-// private final GrowableIntArray leavesDepth;
-// private final GrowableIntArray leavesParent;
+ // private final GrowableIntArray leavesDepth;
+ // private final GrowableIntArray leavesParent;
private final GrowableIntArray leavesAttributeCount;
private final GrowableIntArray leavesChildrenCount;
@@ -110,11 +110,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
pendingText = false;
leavesKind = new GrowableIntArray(600);
- leavesStart = new GrowableIntArray(600);
+ //leavesStart = new GrowableIntArray(600);
leavesABVS = new ArrayBackedValueStorage();
leavesEnd = new GrowableIntArray(600);
-// leavesDepth = new GrowableIntArray(600);
-// leavesParent = new GrowableIntArray(600);
+ // leavesDepth = new GrowableIntArray(600);
+ // leavesParent = new GrowableIntArray(600);
leavesAttributeCount = new GrowableIntArray(600);
leavesChildrenCount = new GrowableIntArray(600);
previousLeaf = new GrowableIntArray(600);
@@ -209,11 +209,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
@Override
public void startDocument() throws SAXException {
leavesKind.clear();
- leavesStart.clear();
+ //leavesStart.clear();
leavesABVS.reset();
leavesEnd.clear();
-// leavesDepth.clear();
-// leavesParent.clear();
+ // leavesDepth.clear();
+ // leavesParent.clear();
leavesAttributeCount.clear();
leavesChildrenCount.clear();
previousLeaf.clear();
@@ -381,10 +381,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
}
db.write(abvs);
+ // leavesStart.getArray()[i]
+ int currentOffset = 0;
for (int i = 0; i < leavesKind.getSize(); ++i) {
if (leavesKind.getArray()[i] == LEAF_PRE_DOCUMENT) {
- out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i],
- leavesEnd.getArray()[i] - leavesStart.getArray()[i]);
+ out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset);
int children = leavesChildrenCount.getArray()[i];
if (children > 0) {
@@ -400,15 +401,13 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
enb.setMvs(abvs);
enb.setTagHeader(nsCount, attrCount, childrenCount);
- out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i],
- leavesEnd.getArray()[i] - leavesStart.getArray()[i]);
+ out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset);
if (attrCount > 0) {
sequenceSlotStub(abvs, attrCount);
for (int s = 0; s < attrCount; ++s) {
++i;
- out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i], leavesEnd.getArray()[i]
- - leavesStart.getArray()[i]);
+ out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset);
updateSequenceSlot(abvs);
}
}
@@ -423,10 +422,10 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
} else if (leavesKind.getArray()[i] == LEAF_POST_NODE) {
updateSequenceSlot(abvs);
} else {
- out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i],
- leavesEnd.getArray()[i] - leavesStart.getArray()[i]);
+ out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset);
updateSequenceSlot(abvs);
}
+ currentOffset = leavesEnd.getArray()[i];
}
}
@@ -462,13 +461,13 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler {
private void leafNodeStart(int kind) {
leavesKind.append(kind);
- leavesStart.append(leavesABVS.getLength());
-// leavesDepth.append(textCurrentDepth);
+ //leavesStart.append(leavesABVS.getLength());
+ // leavesDepth.append(textCurrentDepth);
leavesAttributeCount.append(0);
leavesChildrenCount.append(0);
int parent = previousLeaf.getArray()[textCurrentDepth - 1];
-// leavesParent.append(parent);
+ // leavesParent.append(parent);
if (kind == LEAF_POST_NODE || kind == LEAF_POST_DOCUMENT) {
// Skip Count
} else if (kind == LEAF_ATTRIBUTE) {