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

com.g2forge.alexandria.adt.collection.DStreamCollection Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.adt.collection;

import java.util.Collection;
import java.util.Iterator;
import java.util.stream.Collectors;

/**
 * Sub-interface of {@link ICollection} which allows functional implementation of just the {@link ICollection#stream()} method.
 *
 * @param  The type of the elements in this collection.
 */
@FunctionalInterface
public interface DStreamCollection extends ICollection {
	public default Iterator iterator() {
		return stream().iterator();
	}

	public default Collection toCollection() {
		return stream().collect(Collectors.toList());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy