Unary Java SequenceIterator Methods

The unary SequenceIterator methods return a result sequence of the same type, except for match(), which takes a character string argument pattern and returns a Boolean SequenceIterator.

SequenceIterator abs();
Returns the sequence of absolute values of the object's elements.
SequenceIterator neg();
Returns the sequence of the negative of the object's elements.
SequenceIterator match( pattern )
Matches the elements of a sequence of characters with the specified pattern and returns a sequence of Boolean values.

Example

The following code snippet demonstrates unary operators:

    Cursor<Quote> cursor = new Cursor<Quote>(con, Quote.class, "symbol");
    for (Quote quote : cursor)
    {
        ...
        SequenceIterator high = quote.high.iterator();
        SequenceIterator low  = quote.low.iterator();
        SequenceIterator diff;
        SequenceIterator  neg;
        SequenceIterator  abs;
        ...
        diff = high.sub(low);
        neg = diff.neg();

        abs = diff.abs();

        ...
    }