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

factory.IOCollectionFactory Maven / Gradle / Ivy

Go to download

Extension of classic Java data structures that avoid the use of Stream abstraction in favour of direct list transformation methods

The newest version!
package factory;

import operations.IOCollection;
import structures.ArrayList;
import structures.Collection;
import structures.LinkedList;

public class IOCollectionFactory {
	public IOCollection buildWwithNewArrayListOutput(Collection input){
		return new IOCollection() {

			@Override
			public Collection getInput() {
				return input;
			}

			@Override
			public  Collection getOutput() {
				return new ArrayList<>();
			}
		};
	}
	
	public IOCollection buildWwithNewLinkedListOutput(Collection input){
		return new IOCollection() {

			@Override
			public Collection getInput() {
				return input;
			}

			@Override
			public  Collection getOutput() {
				return new LinkedList<>();
			}
		};
	}
	
	public  IOCollection buildWithDefinedCollectionOutput(Collection input, Collection output){
		return new IOCollection() {

			@Override
			public Collection getInput() {
				return input;
			}

			@Override
			public  Collection getOutput() {
				return (Collection) output;
			}
		};
	}
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy