Anderen Logger angefügt

This commit is contained in:
JanUlrich 2014-11-04 13:47:31 +01:00
parent 1cb66d4f88
commit 4401414b67
3 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package de.dhbwstuttgart.logger;
import java.io.PrintStream;
import java.util.HashMap;
import de.dhbwstuttgart.typeinference.exceptions.DebugException;
public class LoggerConfiguration{
private final HashMap<Section,PrintStream> outputs = new HashMap<>(Section.values().length);
public LoggerConfiguration setOutput(Section forSection, PrintStream output){
if(outputs.containsKey(forSection)){
throw new DebugException("Eine outputStream für Section "+forSection+" ist bereits vorhanden");
}
outputs.put(forSection, output);
return this;
}
public void forEach(ConfigurationEvaluater action){
for(Section key : outputs.keySet()){
action.apply(key, outputs.get(key));
}
}
}
interface ConfigurationEvaluater {
public void apply(Section s, PrintStream o);
}

View File

@ -0,0 +1,26 @@
package de.dhbwstuttgart.logger;
import java.util.logging.Level;
/**
* Sämtliche Logging Ausgaben werden in die bei der Erstellung des Loggers übergebene Section eingeteilt
* @author janulrich
*
*/
public class SectionLogger {
private Logger log;
private Section section;
protected SectionLogger(Logger logger, Section s){
this.log = logger;
this.section = s;
}
public void debug(String message){
log.debug(message, section);
}
public void info(String string) {
log.info(string, section);
}
public void error(String string) {
log.error(string, section);
}
}

View File

@ -0,0 +1,44 @@
package de.dhbwstuttgart.typeinference.unify;
import java.util.Vector;
import java.util.stream.Stream;
import de.dhbwstuttgart.typeinference.ConstraintsSet;
import de.dhbwstuttgart.typeinference.Pair;
public class ParallelUnify {
public ParallelUnify(ConstraintsSet constraints){
constraints.getConstraints();
}
private CartesianProduct parallelCartProd(){
return null;
}
private UnifyResult parallelUnify(Vector<Pair> pairs, FC_TTO fc){
UnifyResult ret = new UnifyResult();
return ret;
}
public UnifyResult unify(){
UnifyResult ret = new UnifyResult();
return ret;
}
}
class ParallelConstraintSet extends ConstraintsSet{
Stream parallelGetConstraints(){
return null;
}
}
class UnifyResult{
}
class CartesianProduct{
}