Unary Java SequenceIterator Methods

The unary SequenceIterator methods returna result sequence of the same type or, in the case of match(), takes a character string argument pattern and returns a Boolean SequenceIterator.

SequenceIterator abs();

Return the sequence of absolute values of the object's elements

SequenceIterator neg();

Return the sequence of the negative of the object's elements

SequenceIterator match( pattern ) Match the elements of a sequence of characters with the specified pattern and return a sequence of Boolean values

Example

Following is an example code snippet demonstrating 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();
            
        ...
    }