package org.pfaa.chemica.processing;

import java.util.Arrays;
import java.util.function.Predicate;
import java.util.stream.Stream;

import org.pfaa.chemica.model.Condition;
import org.pfaa.chemica.model.IndustrialMaterial;

public class Compaction extends DegenerateConversion implements Sizing {

	protected Compaction(IndustrialMaterial material) {
		super(material);
	}

	@Override
	public Direction getDirection() {
		return Direction.INCREASE;
	}

	@Override
	public Condition getCondition() {
		return this.getMaterial().getSinteringCondition();
	}

	@Override
	public double getEnergy() {
		return this.getMaterial().getEnthalpyChange(this.getCondition());
	}

	@Override
	public Form getOutputForm(Form inputForm) {
		return inputForm.compact();
	}

	public static Compaction of(IndustrialMaterial material) {
		return new Compaction(material);
	}
	
	public static <T extends Enum<?> & IndustrialMaterial> Stream<Compaction> of(Class<T> material, Predicate<T> predicate) {
		return Arrays.stream(material.getEnumConstants()).filter(predicate).map(Compaction::of);
	}
	
	public static <T extends Enum<?> & IndustrialMaterial> Stream<Compaction> of(Class<T> material) {
		return of(material, (x) -> true);
	}
}

@@ -35,103 +35,8 @@
 g;%0A%0A
-import java.util.Arrays;%0Aimport java.util.function.Predicate;%0Aimport java.util.stream.Stream;%0A%0A
 impo
@@ -759,365 +759,6 @@
 %0A%09%7D%0A
-%09%0A%09public static %3CT extends Enum%3C?%3E & IndustrialMaterial%3E Stream%3CCompaction%3E of(Class%3CT%3E material, Predicate%3CT%3E predicate) %7B%0A%09%09return Arrays.stream(material.getEnumConstants()).filter(predicate).map(Compaction::of);%0A%09%7D%0A%09%0A%09public static %3CT extends Enum%3C?%3E & IndustrialMaterial%3E Stream%3CCompaction%3E of(Class%3CT%3E material) %7B%0A%09%09return of(material, (x) -%3E true);%0A%09%7D%0A
 %7D%0A

remove some dead code