package pl.mkaczara.bch.decoder;
import pl.mkaczara.bch.code.CyclicCode;
import pl.mkaczara.bch.decoder.worker.AbstractBCHDecoderWorker;
import pl.mkaczara.bch.decoder.worker.DedicatedBCHDecoderWorker;
import pl.mkaczara.bch.decoder.worker.SimpleBCHDecoderWorker;
/**
* Klasa reprezentujaca obiekty fabryki dekoderow kodu BCH
*
* @author MichaĆ
*/
public final class BCHDecoderWorkerFactory {
/**
* Pobiera dekoder dla kodu i trybu
*
* @param code kod
* @param simpleDecoder flaga trybu
* @return dekoder
*/
public static AbstractBCHDecoderWorker getBCHDecoderWorker(CyclicCode code, boolean simpleDecoder) {
//Dekoder prosty
if(simpleDecoder){
return new SimpleBCHDecoderWorker(code);
}
return new DedicatedBCHDecoderWorker(code);
}
} // end BCHEncoderWorkerFactory