Class Stats

  • All Implemented Interfaces:
    java.io.Serializable

    public class Stats
    extends java.lang.Object
    implements java.io.Serializable
    Maintains a suite of statistics about all Java project-wide source-code files.
    As the Upgrade Processors are executed, this class maintains a few statistics about the build, and produces the Stats HTML instance, which is subsequently linked to a 'Stats' button on output Java Doc Web-Pages - and also returned to the user after calling the ugrader.

    This class keeps a running log of upgrade-statistics.
    See Also:
    Serialized Form


    • Field Detail

      • serialVersionUID

        🡇     🗕  🗗  🗖
        protected static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
         protected static final long serialVersionUID = 1;
        
      • STATS_HTML_FILENAME

        🡅  🡇     🗕  🗗  🗖
        protected static final java.lang.String STATS_HTML_FILENAME
        The name of the Statistics HTML file saved to the root JavaDoc Directory.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
         protected static final String STATS_HTML_FILENAME = "Stats.html";
        
    • Method Detail

      • getPackageStats

        🡅  🡇     🗕  🗗  🗖
        public Stats getPackageStats​(java.lang.String packageName)
        Global Stats are maintained, but so are package-local statistics. This reetrieves the package-local statistics instance.
        Parameters:
        packageName - The name of one of the upgraded Java Packages, as a String.
        Returns:
        The package-level instance of 'Stats' for that package.
        Code:
        Exact Method Body:
         return packageStatsMap.get(packageName);
        
      • getGlobalTagsCount

        🡅  🡇     🗕  🗗  🗖
        public java.util.Map<java.lang.String,​java.lang.Integer> getGlobalTagsCount
                    ()
        
        Retrieving a count of all Project-Global Tags is done with this getter. It is important to remember that an instance of 'Stats' may be a Project-Global instance, or a Package-Local instance. If 'this' instance of Stats is the 'Project-Global' instance, the integer count-values inside the returned-Map will be aggregate totals (for the whole project) of the number of times your External-HTML <EMBED> tags were used.

        If this method is invoked on one of the Package-Local 'Stats' instances, the returned-Map will hold integer count-values for the Project-Global <EMBED> tags were used inside the particular package for which 'this' statistics-instance was built.

        NOTE: The complete dump of the statistics-tables for the Java HTML Jar Library may be viewed by clicking on the 'Stats' link in the top right corner of this page. The data-tables there show the exact data that's inside the Map's-tables of this class.
        Returns:
        If 'this' instance of 'Stats' is the 'Project-Global' instance, the returned-Map will be the 'Project-Totals' use-count for all Globally-Defined <EMBED class='external-html ..>' Tags.

        If 'this' instance of 'Stats' is a 'Package-Local' instance, the returned-Map will have Package-Local use-counts for all of the Globallly-Defined Tags.
        Code:
        Exact Method Body:
         return (HashMap<String, Integer>) ((HashMap<String, Integer>) globalTagsCount).clone();
        
      • getPackageTagsCount

        🡅  🡇     🗕  🗗  🗖
        public java.util.Map<java.lang.String,​java.lang.Integer> getPackageTagsCount
                    ()
        
        This retrieves an integer count-Map of all Package-Local Embedded HTML (External-HTML) Tags. If 'this' instance of 'Stats' is the Top-Level, Project-Global instance of 'Stats', this method returns null.
        Returns:
        A Map containing counts of the number of times a Package-Local <EMBED CLASS='external-html'> Tag has been used on web-pages that are inside that particular package.

        This method returns null if 'this' instance of 'Stats' is the Global-Instance, rather than one of the Package-Local Instances.
        Code:
        Exact Method Body:
         return (packageTagsCount == null)
             ? null
             : (HashMap<String, Integer>) ((HashMap<String, Integer>) packageTagsCount).clone();
        
      • numLines

        🡅  🡇     🗕  🗗  🗖
        public int numLines()
        Returns:
        A count of the total number of lines of '.java' files.
        Code:
        Exact Method Body:
         return numLines;
        
      • numBytes

        🡅  🡇     🗕  🗗  🗖
        public int numBytes()
        Returns:
        A count of the total number of bytes of '.java' files.
        Code:
        Exact Method Body:
         return numBytes;
        
      • numHiLitedDivs

        🡅  🡇     🗕  🗗  🗖
        public int numHiLitedDivs()
        Returns:
        A count of the total number of HiLited HTML <DIV> Elements.
        Code:
        Exact Method Body:
         return numHiLitedDivs;
        
      • numMethods

        🡅  🡇     🗕  🗗  🗖
        public int numMethods()
        Returns:
        A count of the total number of methods found during the upgrade.
        Code:
        Exact Method Body:
         return numMethods;
        
      • numConstructors

        🡅  🡇     🗕  🗗  🗖
        public int numConstructors()
        Returns:
        A count of the total number of constructors found during the upgrade.
        Code:
        Exact Method Body:
         return numConstructors;
        
      • numFields

        🡅  🡇     🗕  🗗  🗖
        public int numFields()
        Returns:
        A count of the total number of fields found during the upgrade.
        Code:
        Exact Method Body:
         return numFields;
        
      • numAnnotationElems

        🡅  🡇     🗕  🗗  🗖
        public int numAnnotationElems()
        Returns:
        A count of the total number of annotation-elements found during the upgrade.
        Code:
        Exact Method Body:
         return numAnnotationElems;
        
      • numEnumConstants

        🡅  🡇     🗕  🗗  🗖
        public int numEnumConstants()
        Returns:
        A count of the total number of enum-constants found during the upgrade.
        Code:
        Exact Method Body:
         return numEnumConstants;
        
      • numHiLitedMethods

        🡅  🡇     🗕  🗗  🗖
        public int numHiLitedMethods()
        Returns:
        A count of the total number of method bodies hilited by the upgrader.
        Code:
        Exact Method Body:
         return numHiLitedMethods;
        
      • numHiLitedConstructors

        🡅  🡇     🗕  🗗  🗖
        public int numHiLitedConstructors()
        Returns:
        A count of the total number of constructor bodies hilited by the upgrader.
        Code:
        Exact Method Body:
         return numHiLitedConstructors;
        
      • numHiLitedFields

        🡅  🡇     🗕  🗗  🗖
        public int numHiLitedFields()
        Returns:
        A count of the total number of field declarations hilited by the upgrader.
        Code:
        Exact Method Body:
         return numHiLitedFields;
        
      • numHiLitedAnnotationElems

        🡅  🡇     🗕  🗗  🗖
        public int numHiLitedAnnotationElems()
        Returns:
        A count of the total number of annotation-element declarations hilited by the upgrader.
        Code:
        Exact Method Body:
         return numHiLitedAnnotationElems;
        
      • numHiLitedEnumConstants

        🡅  🡇     🗕  🗗  🗖
        public int numHiLitedEnumConstants()
        Returns:
        A count of the total number of enumeration-constant declarations hilited by the upgrader.
        Code:
        Exact Method Body:
         return numHiLitedEnumConstants;
        
      • numDocumentedMethods

        🡅  🡇     🗕  🗗  🗖
        public int numDocumentedMethods()
        Returns:
        A count of the total number of methods that were documented by Java Doc.
        Code:
        Exact Method Body:
         return numDocumentedMethods;
        
      • numDocumentedConstructors

        🡅  🡇     🗕  🗗  🗖
        public int numDocumentedConstructors()
        Returns:
        A count of the total number of constructors that were documented by Java Doc.
        Code:
        Exact Method Body:
         return numDocumentedConstructors;
        
      • numDocumentedFields

        🡅  🡇     🗕  🗗  🗖
        public int numDocumentedFields()
        Returns:
        A count of the total number of fields that were documented by Java Doc.
        Code:
        Exact Method Body:
         return numDocumentedFields;
        
      • numDocumentedAnnotationElems

        🡅  🡇     🗕  🗗  🗖
        public int numDocumentedAnnotationElems()
        Returns:
        A count of the total number of annotation-elements that were documented by Java Doc.
        Code:
        Exact Method Body:
         return numDocumentedAnnotationElems;
        
      • numDocumentedEnumConstants

        🡅  🡇     🗕  🗗  🗖
        public int numDocumentedEnumConstants()
        Returns:
        A count of the total number of annotation-elements that were documented by Java Doc.
        Code:
        Exact Method Body:
         return numDocumentedEnumConstants;
        
      • numStaticMethods

        🡅  🡇     🗕  🗗  🗖
        public int numStaticMethods()
        Returns:
        A count of the total number of static methods found during the upgrade.
        Code:
        Exact Method Body:
         return numStaticMethods;
        
      • numStaticFields

        🡅  🡇     🗕  🗗  🗖
        public int numStaticFields()
        Returns:
        A count of the total number of static fields found during the upgrade.
        Code:
        Exact Method Body:
         return numStaticFields;
        
      • numFinalMethods

        🡅  🡇     🗕  🗗  🗖
        public int numFinalMethods()
        Returns:
        A count of the total number of final methods found by the upgrade.
        Code:
        Exact Method Body:
         return numFinalMethods;
        
      • numFinalConstructors

        🡅  🡇     🗕  🗗  🗖
        public int numFinalConstructors()
        Returns:
        A count of the total number of final constructors found by the upgrader.
        Code:
        Exact Method Body:
         return numFinalConstructors;
        
      • numFinalFields

        🡅  🡇     🗕  🗗  🗖
        public int numFinalFields()
        Returns:
        A count of the total number of final fields found by the upgrader.
        Code:
        Exact Method Body:
         return numFinalFields;
        
      • numPublicMethods

        🡅  🡇     🗕  🗗  🗖
        public int numPublicMethods()
        Returns:
        A count of the total number of public methods found by the upgrader.
        Code:
        Exact Method Body:
         return numPublicMethods;
        
      • numPublicConstructors

        🡅  🡇     🗕  🗗  🗖
        public int numPublicConstructors()
        Returns:
        A count of the total number of public constructors found by the upgrader.
        Code:
        Exact Method Body:
         return numPublicConstructors;
        
      • numPublicFields

        🡅  🡇     🗕  🗗  🗖
        public int numPublicFields()
        Returns:
        A count of the total number of public fields found by the upgrader.
        Code:
        Exact Method Body:
         return numPublicFields;
        
      • numProtectedMethods

        🡅  🡇     🗕  🗗  🗖
        public int numProtectedMethods()
        Returns:
        The total number of protected methods found during the upgrade.
        Code:
        Exact Method Body:
         return numProtectedMethods;
        
      • numProtectedFields

        🡅  🡇     🗕  🗗  🗖
        public int numProtectedFields()
        Returns:
        The total number of protected fields found during the upgrade.
        Code:
        Exact Method Body:
         return numProtectedFields;
        
      • numPrivateMethods

        🡅  🡇     🗕  🗗  🗖
        public int numPrivateMethods()
        Returns:
        The total number of private methods found during the upgrade.
        Code:
        Exact Method Body:
         return numPrivateMethods;
        
      • numPrivateFields

        🡅  🡇     🗕  🗗  🗖
        public int numPrivateFields()
        Returns:
        The total number of private fields found during the upgrade.
        Code:
        Exact Method Body:
         return numPrivateFields;
        
      • numTransientFields

        🡅  🡇     🗕  🗗  🗖
        public int numTransientFields()
        Returns:
        A count of the total number of transient fields found during the upgrade.
        Code:
        Exact Method Body:
         return numTransientFields;
        
      • numVolatileFields

        🡅  🡇     🗕  🗗  🗖
        public int numVolatileFields()
        Returns:
        A count of the total number of volatile fields found during the upgrade.
        Code:
        Exact Method Body:
         return numVolatileFields;
        
      • toString

        🡅     🗕  🗗  🗖
        public java.lang.String toString()
        Generates a String that enapsulates all of the counters / running-totals inside this data statistic class.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A String representation of this class. Only includes statistics about use of methods, constructors, fields etc... DOES NOT INCLUDE statistics regarding the use of the <EMBED CLASS='external-html' ...> tags.
        Code:
        Exact Method Body:
         StringBuilder sb = new StringBuilder();
        
         for (String packageName : packageStatsMap.keySet()) sb.append(
             "Stats for Package: [" + BCYAN + packageName + RESET + "]:\n\n" +
             StrIndent.indent(toStringINTERNAL(packageStatsMap.get(packageName)), 4) + '\n'
         );
        
         sb.append("UPGADE / BUILD TOTAL:\n\n" + toStringINTERNAL(this));
        
         return sb.toString();