/** * Get the result as a boolean */ public boolean effectiveBooleanValue(XPathContext context) throws XPathException { // First create an iteration of the base sequence. SequenceIterator base = sequence.iterate(context); // Now test to see if some or all of the tests are true. The same // logic is used for the SOME and EVERY operators final boolean some = (operator==Token.SOME); int slot = getLocalSlotNumber(); while (true) { final Item it = base.next(); if (it == null) { break; } context.setLocalVariable(slot, it); if (some == action.effectiveBooleanValue(context)) { return some; } } return !some; }
/** * Get the result as a boolean */ public boolean effectiveBooleanValue(XPathContext context) throws XPathException { // First create an iteration of the base sequence. SequenceIterator base = sequence.iterate(context); // Now test to see if some or all of the tests are true. The same // logic is used for the SOME and EVERY operators final boolean some = (operator==Token.SOME); int slot = getLocalSlotNumber(); while (true) { final Item it = base.next(); if (it == null) { break; } context.setLocalVariable(slot, it); if (some == action.effectiveBooleanValue(context)) { return some; } } return !some; }
/** * Get the result as a boolean */ public boolean effectiveBooleanValue(XPathContext context) throws XPathException { // First create an iteration of the base sequence. SequenceIterator base = sequence.iterate(context); // Now test to see if some or all of the tests are true. The same // logic is used for the SOME and EVERY operators final boolean some = (operator==Token.SOME); int slot = getLocalSlotNumber(); while (true) { final Item it = base.next(); if (it == null) { break; } context.setLocalVariable(slot, it); if (some == action.effectiveBooleanValue(context)) { base.close(); return some; } } return !some; }
/** * Get the result as a boolean */ public boolean effectiveBooleanValue(XPathContext context) throws XPathException { // First create an iteration of the base sequence. SequenceIterator<?> base = getSequence().iterate(context); // Now test to see if some or all of the tests are true. The same // logic is used for the SOME and EVERY operators final boolean some = operator == Token.SOME; int slot = getLocalSlotNumber(); Item<?> it; while ((it = base.next()) != null) { context.setLocalVariable(slot, it); if (some == getAction().effectiveBooleanValue(context)) { base.close(); return some; } } return !some; }
/** * Get the result as a boolean */ public boolean effectiveBooleanValue(XPathContext context) throws XPathException { // First create an iteration of the base sequence. SequenceIterator<?> base = getSequence().iterate(context); // Now test to see if some or all of the tests are true. The same // logic is used for the SOME and EVERY operators final boolean some = operator == Token.SOME; int slot = getLocalSlotNumber(); Item<?> it; while ((it = base.next()) != null) { context.setLocalVariable(slot, it); if (some == getAction().effectiveBooleanValue(context)) { base.close(); return some; } } return !some; }