OSDN Git Service

Performance improvements when switching notebooks or selecting tags by removing the...
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / utilities / SyncTimes.java
1 /*\r
2  * This file is part of NeverNote \r
3  * Copyright 2009 Randy Baumgarte\r
4  * \r
5  * This file may be licensed under the terms of of the\r
6  * GNU General Public License Version 2 (the ``GPL'').\r
7  *\r
8  * Software distributed under the License is distributed\r
9  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either\r
10  * express or implied. See the GPL for the specific language\r
11  * governing rights and limitations.\r
12  *\r
13  * You should have received a copy of the GPL along with this\r
14  * program. If not, go to http://www.gnu.org/licenses/gpl.html\r
15  * or write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
17  *\r
18 */\r
19 package cx.fbn.nevernote.utilities;\r
20 \r
21 import java.util.ArrayList;\r
22 import java.util.List;\r
23 \r
24 public class SyncTimes {\r
25         private final List<String> stringTimes;\r
26         private final List<Integer> minuteTimes;\r
27         \r
28         public SyncTimes() {\r
29                 stringTimes = new ArrayList<String>();\r
30                 minuteTimes = new ArrayList<Integer>();\r
31                 \r
32                 stringTimes.add("manually");\r
33                 minuteTimes.add(0);\r
34                 \r
35                 stringTimes.add("15 minutes");\r
36                 minuteTimes.add(15);\r
37                 \r
38                 stringTimes.add("30 minutes");\r
39                 minuteTimes.add(30);\r
40                 \r
41                 stringTimes.add("45 minutes");\r
42                 minuteTimes.add(45);\r
43                 \r
44                 stringTimes.add("60 minutes");\r
45                 minuteTimes.add(60);\r
46                 \r
47                 stringTimes.add("120 minutes");\r
48                 minuteTimes.add(120);\r
49                 \r
50                 stringTimes.add("240 minutes");\r
51                 minuteTimes.add(240);\r
52                 \r
53                 stringTimes.add("600 minutes");\r
54                 minuteTimes.add(600);\r
55                 \r
56                 stringTimes.add("Shortly after the end of the world");\r
57                 minuteTimes.add(-1);\r
58         }\r
59         \r
60         public List<String> stringValues() {\r
61                 return stringTimes;\r
62         }\r
63         \r
64         public int timeValue(String t) {\r
65                 for (int i=0; i<stringTimes.size(); i++) \r
66                         if (stringTimes.get(i).equalsIgnoreCase(t))\r
67                                 return minuteTimes.get(i);\r
68                 \r
69                 return 15;\r
70         }\r
71 }\r