Class SimpleEnumeratingScheme

  • All Implemented Interfaces:
    NamingScheme

    public class SimpleEnumeratingScheme
    extends java.lang.Object
    implements NamingScheme
    Simple enumerating naming scheme. Cluster names are generated as follows:
    1. if the cluster has a name assigned, use it
    2. otherwise use getNameAutomatic() as name, and add an enumeration postfix
    Since:
    0.2
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Clustering<?> clustering
      Clustering this scheme is applied to.
      private it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<java.lang.String> namefreq
      Count how often each name occurred so far.
      private java.util.Map<Cluster<?>,​java.lang.String> names
      Assigned cluster names.
      private static java.lang.String NULLPOSTFIX
      This is the postfix added to the first cluster, which will be removed when there is only one cluster of this name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getNameFor​(Cluster<?> cluster)
      Retrieve the cluster name.
      private void updateNames()
      Assign names to each cluster (which doesn't have a name yet)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • clustering

        private Clustering<?> clustering
        Clustering this scheme is applied to.
      • namefreq

        private it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap<java.lang.String> namefreq
        Count how often each name occurred so far.
      • names

        private java.util.Map<Cluster<?>,​java.lang.String> names
        Assigned cluster names.
      • NULLPOSTFIX

        private static final java.lang.String NULLPOSTFIX
        This is the postfix added to the first cluster, which will be removed when there is only one cluster of this name.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SimpleEnumeratingScheme

        public SimpleEnumeratingScheme​(Clustering<?> clustering)
        Constructor.
        Parameters:
        clustering - Clustering result to name.
    • Method Detail

      • updateNames

        private void updateNames()
        Assign names to each cluster (which doesn't have a name yet)
      • getNameFor

        public java.lang.String getNameFor​(Cluster<?> cluster)
        Retrieve the cluster name. When a name has not yet been assigned, call updateNames()
        Specified by:
        getNameFor in interface NamingScheme
        Parameters:
        cluster - cluster to get a name for
        Returns:
        cluster name