Product Information > JADE Encyclopaedia of Classes – Volume 2 > Chapter 1 - System Classes > back

back

back(value: Any output): Boolean;

The back method of the MergeIterator class accesses entries in reverse order one at a time in the dictionaries comprising the merged iterator view.

This method returns true when a prior entry is found, and the entry is assigned to the value parameter. It returns false when a prior entry is not found because the iterator is positioned before the first entry in the merged view, and the value parameter becomes a null reference.

The following example shows the use of the back method.

getReversedPosition(pObj: Object; pIter: MergeIterator): Integer;
vars
    pos : Integer;
    obj : Object;
begin
    while pIter.back(obj) do
        pos := pos - 1;
        if obj = pObj then
            return pos;
        endif;
    endwhile;
    return 0;
end;