Universe::JavaIterator class

The JavaIterator class is a wrapper allowing to easily handle Java objects that are instances of Iterator.

Public static functions

static auto forIterable(const easyjni::JavaObject& iterable) -> Universe::JavaIterator
static auto of(easyjni::JavaObject iterator) -> Universe::JavaIterator

Public functions

auto operator*() -> easyjni::JavaObject
auto hasNext() -> bool
auto next() -> easyjni::JavaObject
void remove()

Function documentation

static Universe::JavaIterator Universe::JavaIterator::forIterable(const easyjni::JavaObject& iterable)

Parameters
iterable The existing Java iterable object.
Returns The wrapper for the iterator of the object.

Creates a new JavaIterator from an existing Java object that is an instance of Iterable.

static Universe::JavaIterator Universe::JavaIterator::of(easyjni::JavaObject iterator)

Parameters
iterator The existing Java object.
Returns The wrapper for the object.

Creates a new JavaIterator from an existing Java object that is an instance of Iterator.

easyjni::JavaObject Universe::JavaIterator::operator*()

Returns The wrapped Java object.

Gives the Java object that is wrapped in this JavaIterator.

bool Universe::JavaIterator::hasNext()

Returns If there is a next element.

Checks whether there is a next element to iterate over.

easyjni::JavaObject Universe::JavaIterator::next()

Returns The next element.

Gives the next element of the iteration.

void Universe::JavaIterator::remove()

Removes the current element.