X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureAttributes.java;fp=src%2Fjalview%2Fdatamodel%2Ffeatures%2FFeatureAttributes.java;h=f51fe48f53969df0ea1e98e5e885501e298068f0;hb=a83adb45bdf9554e270921b4baad94defd314b36;hp=7acebee51d8e80a2ada4601320acc72f0e3aad47;hpb=d4ec118f86b5c9dee801e743c46aaacc7bb521d1;p=jalview.git diff --git a/src/jalview/datamodel/features/FeatureAttributes.java b/src/jalview/datamodel/features/FeatureAttributes.java index 7acebee..f51fe48 100644 --- a/src/jalview/datamodel/features/FeatureAttributes.java +++ b/src/jalview/datamodel/features/FeatureAttributes.java @@ -1,5 +1,8 @@ package jalview.datamodel.features; +import jalview.bin.ApplicationSingletonProvider; +import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI; + import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -12,14 +15,23 @@ import java.util.TreeMap; /** * A singleton class to hold the set of attributes known for each feature type */ -public class FeatureAttributes +public class FeatureAttributes implements ApplicationSingletonI { public enum Datatype { Character, Number, Mixed } - private static FeatureAttributes instance = new FeatureAttributes(); + public static FeatureAttributes getInstance() + { + return (FeatureAttributes) ApplicationSingletonProvider + .getInstance(FeatureAttributes.class); + } + + private FeatureAttributes() + { + attributes = new HashMap<>(); + } /* * map, by feature type, of a map, by attribute name, of @@ -173,21 +185,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