koppeling voorkomst, ander algoritme
This commit is contained in:
parent
984c1e3005
commit
b5504912ce
|
@ -0,0 +1,10 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
|
@ -0,0 +1,46 @@
|
|||
package com.brainbaking.dictee;
|
||||
|
||||
public class Tuple {
|
||||
private final Character character;
|
||||
private final int index;
|
||||
private final int extraMinpunt;
|
||||
|
||||
public int getExtraMinpunt() {
|
||||
return extraMinpunt;
|
||||
}
|
||||
|
||||
public static Tuple nietGevonden(int character) {
|
||||
return new Tuple(character, -1, 0);
|
||||
}
|
||||
|
||||
public static Tuple hoofdletter(int character, int index) {
|
||||
return new Tuple(character, index, 1);
|
||||
}
|
||||
|
||||
public boolean isChar(int chara) {
|
||||
return character == (char) chara;
|
||||
}
|
||||
|
||||
public Tuple(int ch, int index) {
|
||||
this(ch, index, 0);
|
||||
}
|
||||
|
||||
public boolean komtNietVoor() {
|
||||
return index < 0;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
private Tuple(int character, int index, int extraMinpunt) {
|
||||
this.character = (char) character;
|
||||
this.index = index;
|
||||
this.extraMinpunt = extraMinpunt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "(" + character + "," + index + ")";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue