Skip to content

Commit bfb4edc

Browse files
committed
Rename remaining *List to *s
1 parent 0e1027c commit bfb4edc

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

app/src/main/java/io/github/yawnoc/strokeinput/StrokeInputService.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,11 @@ public void onKey(final String valueText)
557557
private void effectStrokeAppend(final String strokeDigit)
558558
{
559559
final String newStrokeDigitSequence = strokeDigitSequence + strokeDigit;
560-
final List<String> newCandidateList = computeCandidates(newStrokeDigitSequence);
561-
if (newCandidateList.size() > 0)
560+
final List<String> newCandidates = computeCandidates(newStrokeDigitSequence);
561+
if (newCandidates.size() > 0)
562562
{
563563
setStrokeDigitSequence(newStrokeDigitSequence);
564-
setCandidates(newCandidateList);
564+
setCandidates(newCandidates);
565565
}
566566
}
567567

@@ -570,10 +570,10 @@ private void effectBackspace(final InputConnection inputConnection)
570570
if (strokeDigitSequence.length() > 0)
571571
{
572572
final String newStrokeDigitSequence = Stringy.removeSuffixRegex("(?s).", strokeDigitSequence);
573-
final List<String> newCandidateList = computeCandidates(newStrokeDigitSequence);
573+
final List<String> newCandidates = computeCandidates(newStrokeDigitSequence);
574574

575575
setStrokeDigitSequence(newStrokeDigitSequence);
576-
setCandidates(newCandidateList);
576+
setCandidates(newCandidates);
577577

578578
if (newStrokeDigitSequence.length() == 0)
579579
{
@@ -721,15 +721,15 @@ private void setCandidates(final List<String> candidates)
721721

722722
private void setPhraseCompletionCandidates(final InputConnection inputConnection)
723723
{
724-
List<String> phraseCompletionCandidateList = computePhraseCompletionCandidates(inputConnection);
724+
List<String> phraseCompletionCandidates = computePhraseCompletionCandidates(inputConnection);
725725

726726
phraseCompletionFirstCodePoints.clear();
727-
for (final String phraseCompletionCandidate : phraseCompletionCandidateList)
727+
for (final String phraseCompletionCandidate : phraseCompletionCandidates)
728728
{
729729
phraseCompletionFirstCodePoints.add(Stringy.getFirstCodePoint(phraseCompletionCandidate));
730730
}
731731

732-
setCandidates(phraseCompletionCandidateList);
732+
setCandidates(phraseCompletionCandidates);
733733
}
734734

735735
/*
@@ -738,7 +738,7 @@ private void setPhraseCompletionCandidates(final InputConnection inputConnection
738738
private Comparator<String> candidateComparator(
739739
final Set<Integer> unpreferredCodePointSet,
740740
final Map<Integer, Integer> sortingRankFromCodePoint,
741-
final List<Integer> phraseCompletionFirstCodePointList
741+
final List<Integer> phraseCompletionFirstCodePoints
742742
)
743743
{
744744
return
@@ -748,7 +748,7 @@ private Comparator<String> candidateComparator(
748748
string,
749749
unpreferredCodePointSet,
750750
sortingRankFromCodePoint,
751-
phraseCompletionFirstCodePointList
751+
phraseCompletionFirstCodePoints
752752
)
753753
);
754754
}
@@ -759,7 +759,7 @@ private Comparator<String> candidateComparator(
759759
private Comparator<Integer> candidateCodePointComparator(
760760
final Set<Integer> unpreferredCodePointSet,
761761
final Map<Integer, Integer> sortingRankFromCodePoint,
762-
final List<Integer> phraseCompletionFirstCodePointList
762+
final List<Integer> phraseCompletionFirstCodePoints
763763
)
764764
{
765765
return
@@ -770,7 +770,7 @@ private Comparator<Integer> candidateCodePointComparator(
770770
1,
771771
unpreferredCodePointSet,
772772
sortingRankFromCodePoint,
773-
phraseCompletionFirstCodePointList
773+
phraseCompletionFirstCodePoints
774774
)
775775
);
776776
}
@@ -782,7 +782,7 @@ private int computeCandidateRank(
782782
final String string,
783783
final Set<Integer> unpreferredCodePointSet,
784784
final Map<Integer, Integer> sortingRankFromCodePoint,
785-
final List<Integer> phraseCompletionFirstCodePointList
785+
final List<Integer> phraseCompletionFirstCodePoints
786786
)
787787
{
788788
final int firstCodePoint = Stringy.getFirstCodePoint(string);
@@ -794,7 +794,7 @@ private int computeCandidateRank(
794794
stringLength,
795795
unpreferredCodePointSet,
796796
sortingRankFromCodePoint,
797-
phraseCompletionFirstCodePointList
797+
phraseCompletionFirstCodePoints
798798
);
799799
}
800800

@@ -806,15 +806,15 @@ private int computeCandidateRank(
806806
final int stringLength,
807807
final Set<Integer> unpreferredCodePointSet,
808808
final Map<Integer, Integer> sortingRankFromCodePoint,
809-
final List<Integer> phraseCompletionFirstCodePointList
809+
final List<Integer> phraseCompletionFirstCodePoints
810810
)
811811
{
812812
final int coarseRank;
813813
final int fineRank;
814814
final int penalty;
815815

816-
final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePointList.size() == 0;
817-
final int phraseCompletionIndex = phraseCompletionFirstCodePointList.indexOf(firstCodePoint);
816+
final boolean phraseCompletionsIsEmpty = phraseCompletionFirstCodePoints.size() == 0;
817+
final int phraseCompletionIndex = phraseCompletionFirstCodePoints.indexOf(firstCodePoint);
818818
final boolean firstCodePointMatchesPhraseCompletionCandidate = phraseCompletionIndex > 0;
819819

820820
final Integer sortingRank = sortingRankFromCodePoint.get(firstCodePoint);
@@ -865,20 +865,20 @@ private List<String> computeCandidates(final String strokeDigitSequence)
865865
updateCandidateOrderPreference();
866866

867867
final Set<Integer> exactMatchCodePointSet;
868-
final List<String> exactMatchCandidateList;
868+
final List<String> exactMatchCandidates;
869869
final String exactMatchCharacters = charactersFromStrokeDigitSequence.get(strokeDigitSequence);
870870
if (exactMatchCharacters != null)
871871
{
872872
exactMatchCodePointSet = Stringy.toCodePointSet(exactMatchCharacters);
873-
exactMatchCandidateList = Stringy.toCharacterList(exactMatchCharacters);
874-
exactMatchCandidateList.sort(
873+
exactMatchCandidates = Stringy.toCharacterList(exactMatchCharacters);
874+
exactMatchCandidates.sort(
875875
candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints)
876876
);
877877
}
878878
else
879879
{
880880
exactMatchCodePointSet = Collections.emptySet();
881-
exactMatchCandidateList = Collections.emptyList();
881+
exactMatchCandidates = Collections.emptyList();
882882
}
883883

884884
final Collection<String> prefixMatchCharactersCollection =
@@ -897,21 +897,21 @@ private List<String> computeCandidates(final String strokeDigitSequence)
897897
prefixMatchCodePointSet.retainAll(commonCodePoints);
898898
}
899899

900-
final List<Integer> prefixMatchCandidateCodePointList = new ArrayList<>(prefixMatchCodePointSet);
901-
prefixMatchCandidateCodePointList.sort(
900+
final List<Integer> prefixMatchCandidateCodePoints = new ArrayList<>(prefixMatchCodePointSet);
901+
prefixMatchCandidateCodePoints.sort(
902902
candidateCodePointComparator(unpreferredCodePoints, sortingRankFromCodePoint, phraseCompletionFirstCodePoints)
903903
);
904904

905-
final int prefixMatchCount = Math.min(prefixMatchCandidateCodePointList.size(), MAX_PREFIX_MATCH_COUNT);
906-
final List<String> prefixMatchCandidateList = new ArrayList<>();
907-
for (final int prefixMatchCodePoint : prefixMatchCandidateCodePointList.subList(0, prefixMatchCount))
905+
final int prefixMatchCount = Math.min(prefixMatchCandidateCodePoints.size(), MAX_PREFIX_MATCH_COUNT);
906+
final List<String> prefixMatchCandidates = new ArrayList<>();
907+
for (final int prefixMatchCodePoint : prefixMatchCandidateCodePoints.subList(0, prefixMatchCount))
908908
{
909-
prefixMatchCandidateList.add(Stringy.toString(prefixMatchCodePoint));
909+
prefixMatchCandidates.add(Stringy.toString(prefixMatchCodePoint));
910910
}
911911

912912
final List<String> candidates = new ArrayList<>();
913-
candidates.addAll(exactMatchCandidateList);
914-
candidates.addAll(prefixMatchCandidateList);
913+
candidates.addAll(exactMatchCandidates);
914+
candidates.addAll(prefixMatchCandidates);
915915

916916
return candidates;
917917
}
@@ -936,7 +936,7 @@ private List<String> computePhraseCompletionCandidates(final InputConnection inp
936936
{
937937
updateCandidateOrderPreference();
938938

939-
final List<String> phraseCompletionCandidateList = new ArrayList<>();
939+
final List<String> phraseCompletionCandidates = new ArrayList<>();
940940

941941
for (
942942
String phrasePrefix = getTextBeforeCursor(inputConnection, MAX_PHRASE_LENGTH - 1);
@@ -949,23 +949,23 @@ private List<String> computePhraseCompletionCandidates(final InputConnection inp
949949
phrasePrefix, false,
950950
phrasePrefix + Character.MAX_VALUE, false
951951
);
952-
final List<String> prefixMatchPhraseCompletionList = new ArrayList<>();
952+
final List<String> prefixMatchPhraseCompletions = new ArrayList<>();
953953

954954
for (final String phraseCandidate : prefixMatchPhraseCandidateSet)
955955
{
956956
final String phraseCompletion = Stringy.removePrefix(phrasePrefix, phraseCandidate);
957-
if (!phraseCompletionCandidateList.contains(phraseCompletion))
957+
if (!phraseCompletionCandidates.contains(phraseCompletion))
958958
{
959-
prefixMatchPhraseCompletionList.add(phraseCompletion);
959+
prefixMatchPhraseCompletions.add(phraseCompletion);
960960
}
961961
}
962-
prefixMatchPhraseCompletionList.sort(
962+
prefixMatchPhraseCompletions.sort(
963963
candidateComparator(unpreferredCodePoints, sortingRankFromCodePoint, Collections.emptyList())
964964
);
965-
phraseCompletionCandidateList.addAll(prefixMatchPhraseCompletionList);
965+
phraseCompletionCandidates.addAll(prefixMatchPhraseCompletions);
966966
}
967967

968-
return phraseCompletionCandidateList;
968+
return phraseCompletionCandidates;
969969
}
970970

971971
private String getTextBeforeCursor(final InputConnection inputConnection, final int characterCount)

0 commit comments

Comments
 (0)