Created
August 24, 2018 10:02
-
-
Save MrChebik/998e3b1cadbc6e4ab28cf3c741fa3fe4 to your computer and use it in GitHub Desktop.
Id - Collector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CollectorAutocompleteText { | |
public static String[] flag; | |
public static List<String> packageName; | |
public static List<String> returnTypeS; | |
static { | |
flag = new String[] {"A", "C", "I", "M", "V", "?"}; | |
packageName = new ArrayList<>(); | |
returnTypeS = new ArrayList<>(); | |
} | |
public static int addPackageName(String text) { | |
return addToList(packageName, text); | |
} | |
public static int addReturnTypeS(String text) { | |
return addToList(returnTypeS, text); | |
} | |
private static int addToList(List<String> list, String text) { | |
for (int i = 0; i < list.size(); i++) | |
if (list.get(i).equals(text)) | |
return i; | |
list.add(text); | |
return list.size() - 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment