factory.IOCollectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nostream Show documentation
Show all versions of nostream Show documentation
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