Construct a Trie from a native string, where the separator is determined by the native filesystem separator char. s @param str @return
(String str)
| 276 | * @return |
| 277 | */ |
| 278 | public static Trie fromNativeString(String str) { |
| 279 | String[] components = str.split(Pattern.quote(File.separator)); |
| 280 | Trie r = ROOT; |
| 281 | for(int i=0;i!=components.length;++i) { |
| 282 | r = r.append(components[i]); |
| 283 | } |
| 284 | return r; |
| 285 | } |
| 286 | |
| 287 | // ========================================================= |
| 288 | // Private Methods |