+ /**
+ * Try to load a score matrix from the given resource file, and if successful,
+ * register it. Answers true if successful, else false. Any errors are
+ * reported on syserr but not thrown.
+ *
+ * @param string
+ */
+ boolean loadScoreMatrix(String resourcePath)
+ {
+ URL url = this.getClass().getResource(resourcePath);
+ if (url == null)
+ {
+ System.err.println("Failed to locate " + resourcePath);
+ return false;
+ }
+ boolean success = false;
+ InputStream is = null;
+ try
+ {
+ is = url.openStream();
+ ScoreMatrix sm = ScoreMatrix.parse(is);
+ if (sm != null)
+ {
+ registerScoreModel(sm);
+ success = true;
+ }
+ } catch (IOException e)
+ {
+ } finally
+ {
+ if (is != null)
+ {
+ try
+ {
+ is.close();
+ } catch (IOException e)
+ {
+ }
+ }
+ }
+ return success;
+ }
+
+ /**
+ * Answers an iterable set of the registered score models. Currently these are
+ * ordered by name (not case sensitive).
+ *
+ * @return
+ */
+ public Iterable<ScoreModelI> getModels()