6
|
1 |
/*
|
|
2 |
* reserved comment block
|
|
3 |
* DO NOT REMOVE OR ALTER!
|
|
4 |
*/
|
|
5 |
/*
|
|
6 |
* Copyright 1999-2004 The Apache Software Foundation.
|
|
7 |
*
|
|
8 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9 |
* you may not use this file except in compliance with the License.
|
|
10 |
* You may obtain a copy of the License at
|
|
11 |
*
|
|
12 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13 |
*
|
|
14 |
* Unless required by applicable law or agreed to in writing, software
|
|
15 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17 |
* See the License for the specific language governing permissions and
|
|
18 |
* limitations under the License.
|
|
19 |
*/
|
|
20 |
/*
|
|
21 |
* $Id: UnionPathIterator.java,v 1.2.4.1 2005/09/14 19:43:25 jeffsuttor Exp $
|
|
22 |
*/
|
|
23 |
package com.sun.org.apache.xpath.internal.axes;
|
|
24 |
|
|
25 |
import com.sun.org.apache.xml.internal.dtm.Axis;
|
|
26 |
import com.sun.org.apache.xml.internal.dtm.DTM;
|
|
27 |
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
|
|
28 |
import com.sun.org.apache.xpath.internal.Expression;
|
|
29 |
import com.sun.org.apache.xpath.internal.ExpressionOwner;
|
|
30 |
import com.sun.org.apache.xpath.internal.XPathVisitor;
|
|
31 |
import com.sun.org.apache.xpath.internal.compiler.Compiler;
|
|
32 |
import com.sun.org.apache.xpath.internal.compiler.OpCodes;
|
12458
|
33 |
import com.sun.org.apache.xpath.internal.compiler.OpMap;
|
6
|
34 |
|
|
35 |
/**
|
|
36 |
* This class extends NodeSetDTM, which implements DTMIterator,
|
|
37 |
* and fetches nodes one at a time in document order based on a XPath
|
|
38 |
* <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
|
|
39 |
* As each node is iterated via nextNode(), the node is also stored
|
|
40 |
* in the NodeVector, so that previousNode() can easily be done.
|
|
41 |
* @xsl.usage advanced
|
|
42 |
*/
|
|
43 |
public class UnionPathIterator extends LocPathIterator
|
|
44 |
implements Cloneable, DTMIterator, java.io.Serializable, PathComponent
|
|
45 |
{
|
|
46 |
static final long serialVersionUID = -3910351546843826781L;
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Constructor to create an instance which you can add location paths to.
|
|
50 |
*/
|
|
51 |
public UnionPathIterator()
|
|
52 |
{
|
|
53 |
|
|
54 |
super();
|
|
55 |
|
|
56 |
// m_mutable = false;
|
|
57 |
// m_cacheNodes = false;
|
|
58 |
m_iterators = null;
|
|
59 |
m_exprs = null;
|
|
60 |
}
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Initialize the context values for this expression
|
|
64 |
* after it is cloned.
|
|
65 |
*
|
|
66 |
* @param context The XPath runtime context for this
|
|
67 |
* transformation.
|
|
68 |
*/
|
|
69 |
public void setRoot(int context, Object environment)
|
|
70 |
{
|
|
71 |
super.setRoot(context, environment);
|
|
72 |
|
|
73 |
try
|
|
74 |
{
|
|
75 |
if (null != m_exprs)
|
|
76 |
{
|
|
77 |
int n = m_exprs.length;
|
|
78 |
DTMIterator newIters[] = new DTMIterator[n];
|
|
79 |
|
|
80 |
for (int i = 0; i < n; i++)
|
|
81 |
{
|
|
82 |
DTMIterator iter = m_exprs[i].asIterator(m_execContext, context);
|
|
83 |
newIters[i] = iter;
|
|
84 |
iter.nextNode();
|
|
85 |
}
|
|
86 |
m_iterators = newIters;
|
|
87 |
}
|
|
88 |
}
|
|
89 |
catch(Exception e)
|
|
90 |
{
|
|
91 |
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(e);
|
|
92 |
}
|
|
93 |
}
|
|
94 |
|
|
95 |
/**
|
|
96 |
* Add an iterator to the union list.
|
|
97 |
*
|
|
98 |
* @param expr non-null reference to a location path iterator.
|
|
99 |
*/
|
|
100 |
public void addIterator(DTMIterator expr)
|
|
101 |
{
|
|
102 |
|
|
103 |
// Increase array size by only 1 at a time. Fix this
|
|
104 |
// if it looks to be a problem.
|
|
105 |
if (null == m_iterators)
|
|
106 |
{
|
|
107 |
m_iterators = new DTMIterator[1];
|
|
108 |
m_iterators[0] = expr;
|
|
109 |
}
|
|
110 |
else
|
|
111 |
{
|
|
112 |
DTMIterator[] exprs = m_iterators;
|
|
113 |
int len = m_iterators.length;
|
|
114 |
|
|
115 |
m_iterators = new DTMIterator[len + 1];
|
|
116 |
|
|
117 |
System.arraycopy(exprs, 0, m_iterators, 0, len);
|
|
118 |
|
|
119 |
m_iterators[len] = expr;
|
|
120 |
}
|
|
121 |
expr.nextNode();
|
|
122 |
if(expr instanceof Expression)
|
|
123 |
((Expression)expr).exprSetParent(this);
|
|
124 |
}
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Detaches the iterator from the set which it iterated over, releasing
|
|
128 |
* any computational resources and placing the iterator in the INVALID
|
|
129 |
* state. After<code>detach</code> has been invoked, calls to
|
|
130 |
* <code>nextNode</code> or<code>previousNode</code> will raise the
|
|
131 |
* exception INVALID_STATE_ERR.
|
|
132 |
*/
|
|
133 |
public void detach()
|
|
134 |
{
|
|
135 |
if(m_allowDetach && null != m_iterators){
|
|
136 |
int n = m_iterators.length;
|
|
137 |
for(int i = 0; i < n; i++)
|
|
138 |
{
|
|
139 |
m_iterators[i].detach();
|
|
140 |
}
|
|
141 |
m_iterators = null;
|
|
142 |
}
|
|
143 |
}
|
|
144 |
|
|
145 |
|
|
146 |
/**
|
|
147 |
* Create a UnionPathIterator object, including creation
|
|
148 |
* of location path iterators from the opcode list, and call back
|
|
149 |
* into the Compiler to create predicate expressions.
|
|
150 |
*
|
|
151 |
* @param compiler The Compiler which is creating
|
|
152 |
* this expression.
|
|
153 |
* @param opPos The position of this iterator in the
|
|
154 |
* opcode list from the compiler.
|
|
155 |
*
|
|
156 |
* @throws javax.xml.transform.TransformerException
|
|
157 |
*/
|
|
158 |
public UnionPathIterator(Compiler compiler, int opPos)
|
|
159 |
throws javax.xml.transform.TransformerException
|
|
160 |
{
|
|
161 |
|
|
162 |
super();
|
|
163 |
|
12458
|
164 |
opPos = OpMap.getFirstChildPos(opPos);
|
6
|
165 |
|
|
166 |
loadLocationPaths(compiler, opPos, 0);
|
|
167 |
}
|
|
168 |
|
|
169 |
/**
|
|
170 |
* This will return an iterator capable of handling the union of paths given.
|
|
171 |
*
|
|
172 |
* @param compiler The Compiler which is creating
|
|
173 |
* this expression.
|
|
174 |
* @param opPos The position of this iterator in the
|
|
175 |
* opcode list from the compiler.
|
|
176 |
*
|
|
177 |
* @return Object that is derived from LocPathIterator.
|
|
178 |
*
|
|
179 |
* @throws javax.xml.transform.TransformerException
|
|
180 |
*/
|
|
181 |
public static LocPathIterator createUnionIterator(Compiler compiler, int opPos)
|
|
182 |
throws javax.xml.transform.TransformerException
|
|
183 |
{
|
|
184 |
// For the moment, I'm going to first create a full UnionPathIterator, and
|
|
185 |
// then see if I can reduce it to a UnionChildIterator. It would obviously
|
|
186 |
// be more effecient to just test for the conditions for a UnionChildIterator,
|
|
187 |
// and then create that directly.
|
|
188 |
UnionPathIterator upi = new UnionPathIterator(compiler, opPos);
|
|
189 |
int nPaths = upi.m_exprs.length;
|
|
190 |
boolean isAllChildIterators = true;
|
|
191 |
for(int i = 0; i < nPaths; i++)
|
|
192 |
{
|
|
193 |
LocPathIterator lpi = upi.m_exprs[i];
|
|
194 |
|
|
195 |
if(lpi.getAxis() != Axis.CHILD)
|
|
196 |
{
|
|
197 |
isAllChildIterators = false;
|
|
198 |
break;
|
|
199 |
}
|
|
200 |
else
|
|
201 |
{
|
|
202 |
// check for positional predicates or position function, which won't work.
|
|
203 |
if(HasPositionalPredChecker.check(lpi))
|
|
204 |
{
|
|
205 |
isAllChildIterators = false;
|
|
206 |
break;
|
|
207 |
}
|
|
208 |
}
|
|
209 |
}
|
|
210 |
if(isAllChildIterators)
|
|
211 |
{
|
|
212 |
UnionChildIterator uci = new UnionChildIterator();
|
|
213 |
|
|
214 |
for(int i = 0; i < nPaths; i++)
|
|
215 |
{
|
|
216 |
PredicatedNodeTest lpi = upi.m_exprs[i];
|
|
217 |
// I could strip the lpi down to a pure PredicatedNodeTest, but
|
|
218 |
// I don't think it's worth it. Note that the test can be used
|
|
219 |
// as a static object... so it doesn't have to be cloned.
|
|
220 |
uci.addNodeTest(lpi);
|
|
221 |
}
|
|
222 |
return uci;
|
|
223 |
|
|
224 |
}
|
|
225 |
else
|
|
226 |
return upi;
|
|
227 |
}
|
|
228 |
|
|
229 |
/**
|
|
230 |
* Get the analysis bits for this walker, as defined in the WalkerFactory.
|
|
231 |
* @return One of WalkerFactory#BIT_DESCENDANT, etc.
|
|
232 |
*/
|
|
233 |
public int getAnalysisBits()
|
|
234 |
{
|
|
235 |
int bits = 0;
|
|
236 |
|
|
237 |
if (m_exprs != null)
|
|
238 |
{
|
|
239 |
int n = m_exprs.length;
|
|
240 |
|
|
241 |
for (int i = 0; i < n; i++)
|
|
242 |
{
|
|
243 |
int bit = m_exprs[i].getAnalysisBits();
|
|
244 |
bits |= bit;
|
|
245 |
}
|
|
246 |
}
|
|
247 |
|
|
248 |
return bits;
|
|
249 |
}
|
|
250 |
|
|
251 |
/**
|
|
252 |
* Read the object from a serialization stream.
|
|
253 |
*
|
|
254 |
* @param stream Input stream to read from
|
|
255 |
*
|
|
256 |
* @throws java.io.IOException
|
|
257 |
* @throws javax.xml.transform.TransformerException
|
|
258 |
*/
|
|
259 |
private void readObject(java.io.ObjectInputStream stream)
|
|
260 |
throws java.io.IOException, javax.xml.transform.TransformerException
|
|
261 |
{
|
|
262 |
try
|
|
263 |
{
|
|
264 |
stream.defaultReadObject();
|
|
265 |
m_clones = new IteratorPool(this);
|
|
266 |
}
|
|
267 |
catch (ClassNotFoundException cnfe)
|
|
268 |
{
|
|
269 |
throw new javax.xml.transform.TransformerException(cnfe);
|
|
270 |
}
|
|
271 |
}
|
|
272 |
|
|
273 |
/**
|
|
274 |
* Get a cloned LocPathIterator that holds the same
|
|
275 |
* position as this iterator.
|
|
276 |
*
|
|
277 |
* @return A clone of this iterator that holds the same node position.
|
|
278 |
*
|
|
279 |
* @throws CloneNotSupportedException
|
|
280 |
*/
|
|
281 |
public Object clone() throws CloneNotSupportedException
|
|
282 |
{
|
|
283 |
|
|
284 |
UnionPathIterator clone = (UnionPathIterator) super.clone();
|
|
285 |
if (m_iterators != null)
|
|
286 |
{
|
|
287 |
int n = m_iterators.length;
|
|
288 |
|
|
289 |
clone.m_iterators = new DTMIterator[n];
|
|
290 |
|
|
291 |
for (int i = 0; i < n; i++)
|
|
292 |
{
|
|
293 |
clone.m_iterators[i] = (DTMIterator)m_iterators[i].clone();
|
|
294 |
}
|
|
295 |
}
|
|
296 |
|
|
297 |
return clone;
|
|
298 |
}
|
|
299 |
|
|
300 |
|
|
301 |
/**
|
|
302 |
* Create a new location path iterator.
|
|
303 |
*
|
|
304 |
* @param compiler The Compiler which is creating
|
|
305 |
* this expression.
|
|
306 |
* @param opPos The position of this iterator in the
|
|
307 |
*
|
|
308 |
* @return New location path iterator.
|
|
309 |
*
|
|
310 |
* @throws javax.xml.transform.TransformerException
|
|
311 |
*/
|
|
312 |
protected LocPathIterator createDTMIterator(
|
|
313 |
Compiler compiler, int opPos) throws javax.xml.transform.TransformerException
|
|
314 |
{
|
|
315 |
LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos,
|
|
316 |
(compiler.getLocationPathDepth() <= 0));
|
|
317 |
return lpi;
|
|
318 |
}
|
|
319 |
|
|
320 |
/**
|
|
321 |
* Initialize the location path iterators. Recursive.
|
|
322 |
*
|
|
323 |
* @param compiler The Compiler which is creating
|
|
324 |
* this expression.
|
|
325 |
* @param opPos The position of this iterator in the
|
|
326 |
* opcode list from the compiler.
|
|
327 |
* @param count The insert position of the iterator.
|
|
328 |
*
|
|
329 |
* @throws javax.xml.transform.TransformerException
|
|
330 |
*/
|
|
331 |
protected void loadLocationPaths(Compiler compiler, int opPos, int count)
|
|
332 |
throws javax.xml.transform.TransformerException
|
|
333 |
{
|
|
334 |
|
|
335 |
// TODO: Handle unwrapped FilterExpr
|
|
336 |
int steptype = compiler.getOp(opPos);
|
|
337 |
|
|
338 |
if (steptype == OpCodes.OP_LOCATIONPATH)
|
|
339 |
{
|
|
340 |
loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
|
|
341 |
|
|
342 |
m_exprs[count] = createDTMIterator(compiler, opPos);
|
|
343 |
m_exprs[count].exprSetParent(this);
|
|
344 |
}
|
|
345 |
else
|
|
346 |
{
|
|
347 |
|
|
348 |
// Have to check for unwrapped functions, which the LocPathIterator
|
|
349 |
// doesn't handle.
|
|
350 |
switch (steptype)
|
|
351 |
{
|
|
352 |
case OpCodes.OP_VARIABLE :
|
|
353 |
case OpCodes.OP_EXTFUNCTION :
|
|
354 |
case OpCodes.OP_FUNCTION :
|
|
355 |
case OpCodes.OP_GROUP :
|
|
356 |
loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1);
|
|
357 |
|
|
358 |
WalkingIterator iter =
|
|
359 |
new WalkingIterator(compiler.getNamespaceContext());
|
|
360 |
iter.exprSetParent(this);
|
|
361 |
|
|
362 |
if(compiler.getLocationPathDepth() <= 0)
|
|
363 |
iter.setIsTopLevel(true);
|
|
364 |
|
|
365 |
iter.m_firstWalker = new com.sun.org.apache.xpath.internal.axes.FilterExprWalker(iter);
|
|
366 |
|
|
367 |
iter.m_firstWalker.init(compiler, opPos, steptype);
|
|
368 |
|
|
369 |
m_exprs[count] = iter;
|
|
370 |
break;
|
|
371 |
default :
|
|
372 |
m_exprs = new LocPathIterator[count];
|
|
373 |
}
|
|
374 |
}
|
|
375 |
}
|
|
376 |
|
|
377 |
/**
|
|
378 |
* Returns the next node in the set and advances the position of the
|
|
379 |
* iterator in the set. After a DTMIterator is created, the first call
|
|
380 |
* to nextNode() returns the first node in the set.
|
|
381 |
* @return The next <code>Node</code> in the set being iterated over, or
|
|
382 |
* <code>null</code> if there are no more members in that set.
|
|
383 |
*/
|
|
384 |
public int nextNode()
|
|
385 |
{
|
|
386 |
if(m_foundLast)
|
|
387 |
return DTM.NULL;
|
|
388 |
|
|
389 |
// Loop through the iterators getting the current fetched
|
|
390 |
// node, and get the earliest occuring in document order
|
|
391 |
int earliestNode = DTM.NULL;
|
|
392 |
|
|
393 |
if (null != m_iterators)
|
|
394 |
{
|
|
395 |
int n = m_iterators.length;
|
|
396 |
int iteratorUsed = -1;
|
|
397 |
|
|
398 |
for (int i = 0; i < n; i++)
|
|
399 |
{
|
|
400 |
int node = m_iterators[i].getCurrentNode();
|
|
401 |
|
|
402 |
if (DTM.NULL == node)
|
|
403 |
continue;
|
|
404 |
else if (DTM.NULL == earliestNode)
|
|
405 |
{
|
|
406 |
iteratorUsed = i;
|
|
407 |
earliestNode = node;
|
|
408 |
}
|
|
409 |
else
|
|
410 |
{
|
|
411 |
if (node == earliestNode)
|
|
412 |
{
|
|
413 |
|
|
414 |
// Found a duplicate, so skip past it.
|
|
415 |
m_iterators[i].nextNode();
|
|
416 |
}
|
|
417 |
else
|
|
418 |
{
|
|
419 |
DTM dtm = getDTM(node);
|
|
420 |
|
|
421 |
if (dtm.isNodeAfter(node, earliestNode))
|
|
422 |
{
|
|
423 |
iteratorUsed = i;
|
|
424 |
earliestNode = node;
|
|
425 |
}
|
|
426 |
}
|
|
427 |
}
|
|
428 |
}
|
|
429 |
|
|
430 |
if (DTM.NULL != earliestNode)
|
|
431 |
{
|
|
432 |
m_iterators[iteratorUsed].nextNode();
|
|
433 |
|
|
434 |
incrementCurrentPos();
|
|
435 |
}
|
|
436 |
else
|
|
437 |
m_foundLast = true;
|
|
438 |
}
|
|
439 |
|
|
440 |
m_lastFetched = earliestNode;
|
|
441 |
|
|
442 |
return earliestNode;
|
|
443 |
}
|
|
444 |
|
|
445 |
/**
|
|
446 |
* This function is used to fixup variables from QNames to stack frame
|
|
447 |
* indexes at stylesheet build time.
|
|
448 |
* @param vars List of QNames that correspond to variables. This list
|
|
449 |
* should be searched backwards for the first qualified name that
|
|
450 |
* corresponds to the variable reference qname. The position of the
|
|
451 |
* QName in the vector from the start of the vector will be its position
|
|
452 |
* in the stack frame (but variables above the globalsTop value will need
|
|
453 |
* to be offset to the current stack frame).
|
|
454 |
*/
|
|
455 |
public void fixupVariables(java.util.Vector vars, int globalsSize)
|
|
456 |
{
|
|
457 |
for (int i = 0; i < m_exprs.length; i++)
|
|
458 |
{
|
|
459 |
m_exprs[i].fixupVariables(vars, globalsSize);
|
|
460 |
}
|
|
461 |
|
|
462 |
}
|
|
463 |
|
|
464 |
/**
|
|
465 |
* The location path iterators, one for each
|
|
466 |
* <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location
|
|
467 |
* path</a> contained in the union expression.
|
|
468 |
* @serial
|
|
469 |
*/
|
|
470 |
protected LocPathIterator[] m_exprs;
|
|
471 |
|
|
472 |
|
|
473 |
/**
|
|
474 |
* The location path iterators, one for each
|
|
475 |
* <a href="http://www.w3.org/TR/xpath#NT-LocationPath">location
|
|
476 |
* path</a> contained in the union expression.
|
|
477 |
* @serial
|
|
478 |
*/
|
|
479 |
protected DTMIterator[] m_iterators;
|
|
480 |
|
|
481 |
/**
|
|
482 |
* Returns the axis being iterated, if it is known.
|
|
483 |
*
|
|
484 |
* @return Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
|
|
485 |
* types.
|
|
486 |
*/
|
|
487 |
public int getAxis()
|
|
488 |
{
|
|
489 |
// Could be smarter.
|
|
490 |
return -1;
|
|
491 |
}
|
|
492 |
|
|
493 |
class iterOwner implements ExpressionOwner
|
|
494 |
{
|
|
495 |
int m_index;
|
|
496 |
|
|
497 |
iterOwner(int index)
|
|
498 |
{
|
|
499 |
m_index = index;
|
|
500 |
}
|
|
501 |
|
|
502 |
/**
|
|
503 |
* @see ExpressionOwner#getExpression()
|
|
504 |
*/
|
|
505 |
public Expression getExpression()
|
|
506 |
{
|
|
507 |
return m_exprs[m_index];
|
|
508 |
}
|
|
509 |
|
|
510 |
/**
|
|
511 |
* @see ExpressionOwner#setExpression(Expression)
|
|
512 |
*/
|
|
513 |
public void setExpression(Expression exp)
|
|
514 |
{
|
|
515 |
|
|
516 |
if(!(exp instanceof LocPathIterator))
|
|
517 |
{
|
|
518 |
// Yuck. Need FilterExprIter. Or make it so m_exprs can be just
|
|
519 |
// plain expressions?
|
|
520 |
WalkingIterator wi = new WalkingIterator(getPrefixResolver());
|
|
521 |
FilterExprWalker few = new FilterExprWalker(wi);
|
|
522 |
wi.setFirstWalker(few);
|
|
523 |
few.setInnerExpression(exp);
|
|
524 |
wi.exprSetParent(UnionPathIterator.this);
|
|
525 |
few.exprSetParent(wi);
|
|
526 |
exp.exprSetParent(few);
|
|
527 |
exp = wi;
|
|
528 |
}
|
|
529 |
else
|
|
530 |
exp.exprSetParent(UnionPathIterator.this);
|
|
531 |
m_exprs[m_index] = (LocPathIterator)exp;
|
|
532 |
}
|
|
533 |
|
|
534 |
}
|
|
535 |
|
|
536 |
/**
|
|
537 |
* @see com.sun.org.apache.xpath.internal.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor)
|
|
538 |
*/
|
|
539 |
public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)
|
|
540 |
{
|
|
541 |
if(visitor.visitUnionPath(owner, this))
|
|
542 |
{
|
|
543 |
if(null != m_exprs)
|
|
544 |
{
|
|
545 |
int n = m_exprs.length;
|
|
546 |
for(int i = 0; i < n; i++)
|
|
547 |
{
|
|
548 |
m_exprs[i].callVisitors(new iterOwner(i), visitor);
|
|
549 |
}
|
|
550 |
}
|
|
551 |
}
|
|
552 |
}
|
|
553 |
|
|
554 |
/**
|
|
555 |
* @see Expression#deepEquals(Expression)
|
|
556 |
*/
|
|
557 |
public boolean deepEquals(Expression expr)
|
|
558 |
{
|
|
559 |
if (!super.deepEquals(expr))
|
|
560 |
return false;
|
|
561 |
|
|
562 |
UnionPathIterator upi = (UnionPathIterator) expr;
|
|
563 |
|
|
564 |
if (null != m_exprs)
|
|
565 |
{
|
|
566 |
int n = m_exprs.length;
|
|
567 |
|
|
568 |
if((null == upi.m_exprs) || (upi.m_exprs.length != n))
|
|
569 |
return false;
|
|
570 |
|
|
571 |
for (int i = 0; i < n; i++)
|
|
572 |
{
|
|
573 |
if(!m_exprs[i].deepEquals(upi.m_exprs[i]))
|
|
574 |
return false;
|
|
575 |
}
|
|
576 |
}
|
|
577 |
else if (null != upi.m_exprs)
|
|
578 |
{
|
|
579 |
return false;
|
|
580 |
}
|
|
581 |
|
|
582 |
return true;
|
|
583 |
}
|
|
584 |
|
|
585 |
|
|
586 |
}
|