package com.menzus.gcj._2012.qualification.c;

import com.menzus.gcj.common.InputBlockParser;
import com.menzus.gcj.common.OutputProducer;
import com.menzus.gcj.common.impl.AbstractProcessorFactory;

public class CProcessorFactory extends AbstractProcessorFactory<CInput, COutputEntry> {
    public CProcessorFactory(String inputFileName) {
	super(inputFileName);
    }

    @Override
    protected InputBlockParser<CInput> createInputBlockParser() {
	return new CInputBlockParser();
    }

    @Override
    protected OutputProducer<CInput, COutputEntry> createOutputProducer() {
	return new COutputProducer();
    }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author AlexR
 */

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;

public class PrintResult {
    
    FileOutputStream fout;
    PrintStream fstream;
    
    public PrintResult(String filename) throws IOException
    {
            fout = new FileOutputStream(filename);
            fstream = new PrintStream(fout);
    }
    
    public void printLine(int caseNum, String line)
    {
        fstream.println("Case #" + (caseNum+1) + ": " + line);
    }
    
    public void close() throws IOException
    {
        fout.close();
    }
}
