import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
+import jalview.util.Platform;
import java.util.List;
+import com.stevesoft.pat.Regex;
+
public class ModellerDescription
{
/**
val = new Integer(v);
field = val.toString();
}
- };
+ }
+
+ private static Regex VALIDATION_REGEX;
+
+ private static Regex getRegex()
+ {
+ return (VALIDATION_REGEX == null
+ ? VALIDATION_REGEX = Platform
+ .newRegex("\\s*((([-0-9]+).?)|FIRST|LAST|@)", null)
+ : VALIDATION_REGEX);
+ }
private resCode validResidueCode(String field)
{
Integer val = null;
- com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex(
- "\\s*((([-0-9]+).?)|FIRST|LAST|@)");
-
+ Regex r = getRegex();
if (!r.search(field))
{
return null; // invalid
// field '" + field + "'");
type = -1; /* invalid field! - throw the FieldSet away */
}
- ;
}
fields.put(Fields[i++], field);
if (st.hasMoreTokens())