package com.alexrnl.subtitlecorrector.correctionstrategy;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;

import com.alexrnl.subtitlecorrector.common.Subtitle;

/**
 * TODO
 * @author Alex
 */
public class LetterReplacement implements Strategy {
	/** Logger */
	private static Logger				lg	= Logger.getLogger(LetterReplacement.class.getName());
	
	private final Parameter<Character>	originalLetter;
	private final Parameter<Character>	newLetter;
	private final Parameter<Boolean>	onlyFromDictionnary;
	private final Parameter<Boolean>	promptBeforeCorrecting;

	/**
	 * Constructor #1.<br />
	 */
	private LetterReplacement () {
		super();
		this.originalLetter = new Parameter<>(ParameterType.FREE, "strategy.letterreplacement.originalletter");
		this.newLetter = new Parameter<>(ParameterType.FREE, "strategy.letterreplacement.newletter");
		this.onlyFromDictionnary = new Parameter<>(ParameterType.BOOLEAN, "strategy.letterreplacement.onlyfromdictionnary", false, true);
		this.promptBeforeCorrecting = new Parameter<>(ParameterType.BOOLEAN, "strategy.letterreplacement.promptbeforecorrecting", false, true);
	}

	@Override
	public List<Parameter<?>> getParameters () {
		final List<Parameter<?>> parameters = new ArrayList<>(4);
		parameters.add(originalLetter);
		parameters.add(newLetter);
		parameters.add(onlyFromDictionnary);
		parameters.add(promptBeforeCorrecting);
		return parameters;
	}
	
	@Override
	public void correct (final Subtitle subtitle) {
		// TODO Auto-generated method stub
		if (!subtitle.getContent().contains(originalLetter.getValue().toString())) {
			return;
		}
		
	}
}

@@ -378,16 +378,55 @@
 e());%0A%09%0A
+%09/** The original letter to replace */%0A
 %09private
@@ -461,32 +461,62 @@
 originalLetter;%0A
+%09/** The new letter to put */%0A
 %09private final P
@@ -546,16 +546,96 @@
 Letter;%0A
+%09/** Flag indicating to replace only in word which are not in the dictionary */%0A
 %09private
@@ -660,24 +660,31 @@
 oolean%3E%09only
+Missing
 FromDictionn
@@ -686,14 +686,90 @@
 tion
-n
 ary;%0A
+%09/** Flag indicating to prompt user each time before replacing the letter */%0A
 %09pri
@@ -1111,24 +1111,31 @@
 %0A%09%09this.only
+Missing
 FromDictionn
@@ -1133,17 +1133,16 @@
 mDiction
-n
 ary = ne
@@ -1221,17 +1221,16 @@
 mdiction
-n
 ary%22, fa
@@ -1584,16 +1584,23 @@
 add(only
+Missing
 FromDict
@@ -1602,17 +1602,16 @@
 mDiction
-n
 ary);%0A%09%09

Add javadoc to LetterReplacement attributes