import jalview.io.DataSourceType;
import jalview.io.FileParse;
import jalview.io.ScoreMatrixFile;
-import jalview.util.Platform;
import java.io.IOException;
import java.util.LinkedHashMap;
private static ScoreModels instance;
+ private Map<String, ScoreModelI> models;
+
/**
* Answers the singleton instance of this class, with lazy initialisation
* (built-in score models are loaded on the first call to this method)
*/
public static ScoreModels getInstance()
{
- ScoreModels m = instance;
- @SuppressWarnings("unused")
- ThreadGroup g = null;
- if (Platform.isJS())
+ if (instance == null)
{
- g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative m = g._jalviewScoreModelsInstance;
- *
- */
+ instance = new ScoreModels();
}
- if (m == null)
- {
- m = new ScoreModels();
- if (Platform.isJS())
- {
- /**
- * @j2sNative g._jalviewScoreModelsInstance = m;
- *
- */
- }
- else
- {
- instance = m;
- }
- }
- return m;
+ return instance;
}
- private Map<String, ScoreModelI> models;
-
/**
* Private constructor to enforce use of singleton. Registers Jalview's
* "built-in" score models: