else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
else if (Double.isInfinite(_value)) return "Infinity";
else return formatNumbers((int)_value);
}
IntegerArray ancestors = new IntegerArray();
// Gather all ancestors that do not match from pattern
int next = _node;
ancestors.add(next); // include self
while ((next = _document.getParent(next)) > END &&
!matchesFrom(next)) {
ancestors.add(next);
}
// Create an array of counters
final int nAncestors = ancestors.cardinality();
final int[] counters = new int[nAncestors];
for (int i = 0; i < nAncestors; i++) {
counters[i] = Integer.MIN_VALUE;
}
// Increment array of counters according to semantics
for (int j = 0, i = nAncestors - 1; i >= 0 ; i--, j++) {
final int counter = counters[j];
final int ancestor = ancestors.at(i);
if (matchesCount(ancestor)) {
_precSiblings.setStartNode(ancestor);
while ((next = _precSiblings.next()) != END) {
if (matchesCount(next)) {