X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureAttributes.java;h=81c670b55dd1c391d6df6ff484f052cda736bc8d;hb=47806656477f02076cac0467c7374e231a59ab7e;hp=7acebee51d8e80a2ada4601320acc72f0e3aad47;hpb=53cc3d8ada4a614d3d5b45c6a6d5c5b7edd709a4;p=jalview.git diff --git a/src/jalview/datamodel/features/FeatureAttributes.java b/src/jalview/datamodel/features/FeatureAttributes.java index 7acebee..81c670b 100644 --- a/src/jalview/datamodel/features/FeatureAttributes.java +++ b/src/jalview/datamodel/features/FeatureAttributes.java @@ -1,5 +1,7 @@ package jalview.datamodel.features; +import jalview.bin.Instance; + import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -19,7 +21,18 @@ public class FeatureAttributes Character, Number, Mixed } - private static FeatureAttributes instance = new FeatureAttributes(); + public static FeatureAttributes getInstance() + { + Instance i = Instance.getInstance(); + return (i.featureAttributes == null + ? i.featureAttributes = new FeatureAttributes() + : i.featureAttributes); + } + + private FeatureAttributes() + { + attributes = new HashMap<>(); + } /* * map, by feature type, of a map, by attribute name, of @@ -173,21 +186,6 @@ public class FeatureAttributes } /** - * Answers the singleton instance of this class - * - * @return - */ - public static FeatureAttributes getInstance() - { - return instance; - } - - private FeatureAttributes() - { - attributes = new HashMap<>(); - } - - /** * Answers the attribute names known for the given feature type, in * alphabetical order (not case sensitive), or an empty set if no attributes * are known. An attribute name is typically 'simple' e.g. "AC", but may be