class DetectionControllerImpl {

    public DetectedParameters detectParameters(CSVParseParameters truthParameters, LineSampler lineSampler,
            LineSamplerFactory samplerFactory, String changed) throws FileNotFoundException
    {
        DetectedParameters result = new DetectedParameters();

        ValuesWithConfidence<? extends ColumnFormatParameters> columnFormat = getColumnFormatResult(truthParameters, lineSampler,
                changed);
        result.setColumnFormatParameter(columnFormat);

        Character tokenDelimiter = getTokenDelimiter(truthParameters.getColumnFormat(), columnFormat.getBestValue());
        Character textDelimiter = getTextDelimiter(truthParameters.getColumnFormat(), columnFormat.getBestValue());
        StringTokenizer tokenizer = new TokenizerFactoryImpl().getTokenizer(truthParameters.getColumnFormat(),
                columnFormat.getBestValue());
        int columnCount = getColumnCount(truthParameters.getColumnFormat(), columnFormat.getBestValue());

        result.setCommentParameter(getCommentResult(truthParameters, lineSampler, changed, tokenDelimiter, textDelimiter));
        result.setHeaderLineParameter(getHeaderLineResult(truthParameters, lineSampler, changed, tokenizer, columnCount));

        char[] quote = null;
        if (textDelimiter != null)
        {
            // create a line sampler with the correct quote type.
            quote = new char[] { textDelimiter.charValue() };
        }

        detectWithTextDelimiter(samplerFactory, quote, truthParameters, result, tokenizer, changed);

        return result;
    }

    public  DetectionControllerImpl(PreferencesRegistry prefsRegistry, ColumnTypeDetector columnTypeDetector);

}