Revision 1519
Added by Jing Tao over 21 years ago
src/edu/ucsb/nceas/metacat/FilteredSubTree.java | ||
---|---|---|
28 | 28 |
|
29 | 29 |
package edu.ucsb.nceas.metacat; |
30 | 30 |
|
31 |
import java.util.Hashtable; |
|
31 | 32 |
import java.util.Stack; |
33 |
import java.util.Vector; |
|
32 | 34 |
import java.sql.PreparedStatement; |
33 | 35 |
import java.sql.SQLException; |
34 | 36 |
import java.sql.ResultSet; |
... | ... | |
47 | 49 |
private String startElementName = null; |
48 | 50 |
private long startNodeId = -1; |
49 | 51 |
private long endNodeId = -1; |
52 |
private Hashtable filteredTree; |
|
50 | 53 |
|
51 | 54 |
|
52 | 55 |
/** |
53 |
* Constructor of subtree |
|
56 |
* Constructor of filteredsubtree
|
|
54 | 57 |
*/ |
55 | 58 |
public FilteredSubTree(String myDocId, String mySubTreeId, |
56 | 59 |
long myStartNodeId, long myEndNodeId) |
... | ... | |
139 | 142 |
return this.endNodeId; |
140 | 143 |
} |
141 | 144 |
|
142 |
/* Put a subtree node into a stack, on top is the start point of subtree*/
|
|
143 |
private Stack getSubTreeNodeList() throws McdbException
|
|
145 |
/** Set a filtered subtree(subtree should be merger equivlent */
|
|
146 |
public void setFilteredSubtree(Hashtable tree)
|
|
144 | 147 |
{ |
148 |
filteredTree = tree; |
|
149 |
} |
|
150 |
|
|
151 |
/** Get unfiltered subtree node list*/ |
|
152 |
public Stack getUnfilteredSubTreeNodeList() throws McdbException |
|
153 |
{ |
|
154 |
|
|
145 | 155 |
PreparedStatement pstmt = null; |
146 | 156 |
DBConnection dbconn = null; |
147 | 157 |
int serialNumber = -1; |
... | ... | |
153 | 163 |
String nodename = null; |
154 | 164 |
String nodeprefix = null; |
155 | 165 |
String nodedata = null; |
166 |
Vector sorteSubTree = new Vector(); |
|
167 |
// order the subtree vector by start node id |
|
168 |
// because the subtree is mergeEquivlent, so there is no nested subtree |
|
156 | 169 |
String sql = "SELECT nodeid, parentnodeid, nodeindex, " + |
157 | 170 |
"nodetype, nodename, nodeprefix, nodedata " + |
158 | 171 |
"FROM xml_nodes WHERE docid = ? AND nodeid >= ? AND " + |
Also available in: Unified diff
Revise the class.