Back to project page Android-Counter-Application.
The source code is released under:
GNU General Public License
If you think the Android project Android-Counter-Application listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ca.ualberta.cs.artem_counter; /*from w w w. j a v a2s . c o m*/ import java.util.ArrayList; import java.util.Collections; import ca.ualberta.cs.artem_counter.Counter.CounterFunctor; public class CounterList { private static ArrayList<Counter> counterList = null; public CounterList() { super(); counterList = new ArrayList<Counter>(); } public static ArrayList<Counter> getCounterList() { if(counterList==null){ counterList = new ArrayList<Counter>(); } return counterList; } public static void setCounterList(ArrayList<Counter> counterList) { CounterList.counterList = counterList; } public static void add(String text){ counterList.add(0,new Counter(text)); } public static Counter getSpecificCounter(int position) { return counterList.get(position); } public static void incrementSpecificCounter(int position) { counterList.get(position).increment(); } public static void resetSpecificCounter(int position){ counterList.get(position).reset(); } public static void deleteSpecificCounter(int position){ counterList.remove(position); } public static void renameSpecificCounter(int position, String text){ counterList.get(position).setName(text); } public static void sort(){ Collections.sort(counterList, new CounterFunctor()); } }