use of org.apache.xpath.axes.WalkingIterator in project j2objc by google.
the class RedundentExprEliminator method countSteps.
/**
* Count the steps in a given location path.
*
* @param lpi The location path iterator that owns the steps.
* @return The number of steps in the given location path.
*/
protected int countSteps(LocPathIterator lpi) {
if (lpi instanceof WalkingIterator) {
WalkingIterator wi = (WalkingIterator) lpi;
AxesWalker aw = wi.getFirstWalker();
int count = 0;
while (null != aw) {
count++;
aw = aw.getNextWalker();
}
return count;
} else
return 1;
}
Aggregations