import jalview.datamodel.SequenceI;
import java.util.Hashtable;
-import java.util.Vector;
+
+import com.stevesoft.pat.Regex;
public class GroupUrlLink
{
}
ptok[ntoks] = link.length();
tmtch[ntoks] = "$$$$$$$$$";
- jalview.util.QuickSort.sortInt(ptok, tmtch);
+ QuickSort.sortInt(ptok, tmtch);
for (int i = 0; i < ntoks; i++)
{
mtch[i] = tmtch[i]; // TODO: check order is ascending
regexReplace[pass] = link.substring(ptok[pass] + mlength, p);
try
{
- com.stevesoft.pat.Regex rg = com.stevesoft.pat.Regex.perlCode("/"
+ Regex rg = Regex.perlCode("/"
+ regexReplace[pass] + "/");
if (rg == null)
{
private String _replaceFor(String token)
{
for (int i = 0; i < mtch.length; i++)
+ {
if (segs[i] > -1 && mtch[i].equals(token))
{
return regexReplace[i];
}
+ }
return null;
}
// iterate through input, collating segments to be inserted into url
StringBuffer matched[] = new StringBuffer[idseq.length];
// and precompile regexes
- com.stevesoft.pat.Regex[] rgxs = new com.stevesoft.pat.Regex[matched.length];
+ Regex[] rgxs = new Regex[matched.length];
for (pass = 0; pass < matched.length; pass++)
{
matched[pass] = new StringBuffer();
if (regexReplace[pass] != null)
{
- rgxs[pass] = com.stevesoft.pat.Regex.perlCode("/"
+ rgxs[pass] = Regex.perlCode("/"
+ regexReplace[pass] + "/");
}
else
}
if (rgxs[pass] != null)
{
- com.stevesoft.pat.Regex rg = rgxs[pass];
+ Regex rg = rgxs[pass];
int rematchat = 0;
// concatenate all matches of re in the given string!
while (rg.searchFrom(idseq[pass][sq], rematchat))