Extra keys are of the form "key name" or "key name:alt1:alt2@next_to".
(String str, String script)
| 120 | |
| 121 | /** Extra keys are of the form "key name" or "key name:alt1:alt2@next_to". */ |
| 122 | public static ExtraKey parse(String str, String script) |
| 123 | { |
| 124 | String[] split_on_at = str.split("@", 2); |
| 125 | String[] key_names = split_on_at[0].split(":"); |
| 126 | KeyValue kv = KeyValue.getKeyByName(key_names[0]); |
| 127 | KeyValue[] alts = new KeyValue[key_names.length-1]; |
| 128 | for (int i = 1; i < key_names.length; i++) |
| 129 | alts[i-1] = KeyValue.getKeyByName(key_names[i]); |
| 130 | KeyValue next_to = null; |
| 131 | if (split_on_at.length > 1) |
| 132 | next_to = KeyValue.getKeyByName(split_on_at[1]); |
| 133 | return new ExtraKey(kv, script, Arrays.asList(alts), next_to); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | public final static class Query |