RegisterSign In

API Documentation: Interface Iterator64Bit

Package: com.mckoi.data

An iterator interface for forward and backward traversal of a sequence of 64-bit values. Iterator64Bit also supports removal of values from the backed collection, and free location assignment of the iterator pointer.

Methods Summary

long size()
void position(long p)
long position()
boolean hasNext()
long next()
boolean hasPrevious()
long previous()
Iterator64Bit copy()
long remove()

Method Details

long size()

Returns the total number of 64-bit values in the group of values defined by the scope of this iterator.

void position(long p)

Moves the position location to the given offset in the iterator address space where 0 will position the iterator to the first location, and -1 to before the first location. Note that for the 'next' method to return the first value in the collection, the position should be set to -1. For the 'previous' method to return the last value in the set, the position must be set to size().

long position()

Returns the current position of the iterator within the address space as initially defined when the iterator was created and after any removal operations (from calls to 'remove') have been performed. A new iterator will always return -1 (before the first entry).

boolean hasNext()

Returns true if there is a value that can be read from a call to the 'next' method. Returns false if the iterator is at the end of the collection and a value may not be read.

long next()

Returns the next 64-bit from the backed collection and moves the position location to the next value in the set.

boolean hasPrevious()

Returns true if there is a value that can be read by a call to the 'previous' method. Returns false if the iterator is at the start of the collection and a value may not be read.

long previous()

Returns the previous 64-bit from the backed collection and moves the position location to the previous value in the collection.

Iterator64Bit copy()

Returns a copy of this iterator over an identical collection of values but with a positional pointer that can be moved independently of this iterator.

long remove()

Removes a value from the set at the current position. This should be used immediately after a 'next' or 'previous' call to remove the value that was last accessed. Note that the call itself acts as a 'next' operation - when this method returns the interator position will point to the next value in the collection.

The text on this page is licensed under the Creative Commons Attribution 3.0 License. Java is a registered trademark of Oracle and/or its affiliates.
Mckoi is Copyright © 2000 - 2020 Diehl and Associates, Inc. All rights reserved.