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

panda.net.nntp.NewsgroupIterator Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package panda.net.nntp;

import java.util.Iterator;

/**
 * Class which wraps an {@code Iterable} of raw newgroup information to generate an
 * {@code Iterable} of the parsed information.
 */
class NewsgroupIterator implements Iterator, Iterable {

	private final Iterator stringIterator;

	public NewsgroupIterator(Iterable iterableString) {
		stringIterator = iterableString.iterator();
	}

	@Override
	public boolean hasNext() {
		return stringIterator.hasNext();
	}

	// @Override
	public NewsgroupInfo next() {
		String line = stringIterator.next();
		return NNTPClient.__parseNewsgroupListEntry(line);
	}

	// @Override
	public void remove() {
		stringIterator.remove();
	}

	// @Override
	public Iterator iterator() {
		return this;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy