All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.container.map.weak.WeakIntHashMapIterator Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.container.map.weak;

import com.softicar.platform.common.core.annotations.Nullable;
import java.util.Iterator;

class WeakIntHashMapIterator<@Nullable V> implements Iterator {

	private final Iterator> iterator;
	private V value;

	public WeakIntHashMapIterator(Iterator> iterator) {

		this.iterator = iterator;
		findNext();
	}

	@Override
	public boolean hasNext() {

		return value != null;
	}

	@Override
	public V next() {

		V value = this.value;
		findNext();
		return value;
	}

	@Override
	public void remove() {

		throw new UnsupportedOperationException();
	}

	private void findNext() {

		value = null;
		while (iterator.hasNext()) {
			WeakIntEntry entry = iterator.next();
			value = entry.get();
			if (value != null) {
				break;
			}
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy