checkValidRange();\r
}\r
\r
+ static com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex(\r
+ "[/][0-9]{1,}[-][0-9]{1,}$");\r
+ static com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex(\r
+ "[0-9]{1,}$");\r
+\r
void parseId()\r
{\r
- // Remove /start-end from sequence\r
- if (name.indexOf("/") > 0)\r
+ // Does sequence have the /start-end signiature?\r
+ if(limitrx.search(name))\r
{\r
- String limits = name.substring(name.lastIndexOf("/")+1);\r
- try\r
- {\r
- StringTokenizer st = new StringTokenizer(limits, "-");\r
- setStart(Integer.valueOf(st.nextToken()).intValue());\r
- setEnd(Integer.valueOf(st.nextToken()).intValue());\r
-\r
- // If we're still in this loop, parsing of start and end was ok\r
- // Therefore remove it from the sequence name\r
- name = name.substring(0, name.lastIndexOf("/"));\r
- }\r
- catch (NumberFormatException ex)\r
- { }\r
+ name = limitrx.left();\r
+ endrx.search(limitrx.stringMatched());\r
+ setStart( Integer.parseInt( limitrx.stringMatched().substring(1,endrx.matchedFrom()-1 )));\r
+ setEnd( Integer.parseInt( endrx.stringMatched() ));\r
}\r
}\r
\r