Logical Java SequenceIterator Methods

The logical Java SequenceIterator methods (except the not operator) take a single argument other, and perform the indicated logical operation on the object's sequence elements as the left operand and the other sequence elements as the right operand. They return a Boolean result SequenceIterator.

The function signatures are of the following two forms (where op is the indicated operation):

 
    SequenceIterator not()
             

or

 
    SequenceIterator  op(SequenceIterator  other)
             

where operator is one of the following:

SequenceIterator not() The element of the result sequence is the logical not of the corresponding element in the object's sequence
SequenceIterator and(SequenceIterator other) The element of the result sequence is the logical and of the corresponding elements in left and right
SequenceIterator or(SequenceIterator other) The element of the result sequence is the logical or of the corresponding elements in left and right
SequenceIterator xor(SequenceIterator other) The element of the result sequence is the logical exclusive or of the corresponding elements in left and right

Example

Following is an example code snippet demonstrating logical operators :

         
    {
        ...
        SequenceIterator high = quote.high.iterator();
        SequenceIterator low = quote.low.iterator();
        SequenceIterator  equal = high == low;
        SequenceIterator  ne = equal.not();
        equal.reset();
        SequenceIterator allTrue = ne || equal;
        ...
    }