Class MethodCountCheck.MethodCounter

  • Enclosing class:
    MethodCountCheck

    private static class MethodCountCheck.MethodCounter
    extends java.lang.Object
    Marker class used to collect data about the number of methods per class. Objects of this class are used on the Stack to count the methods for each class and layer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<Scope,​java.lang.Integer> counts
      Maintains the counts.
      private boolean inInterface
      Indicated is an interface, in which case all methods are public.
      private int total
      Tracks the total.
    • Constructor Summary

      Constructors 
      Constructor Description
      MethodCounter​(boolean inInterface)
      Creates an interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private int getTotal()
      Fetches total number of methods.
      private void increment​(Scope scope)
      Increments to counter by one for the supplied scope.
      private int value​(Scope scope)
      Gets the value of a scope counter.
      • Methods inherited from class java.lang.Object

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

      • counts

        private final java.util.Map<Scope,​java.lang.Integer> counts
        Maintains the counts.
      • inInterface

        private final boolean inInterface
        Indicated is an interface, in which case all methods are public.
      • total

        private int total
        Tracks the total.
    • Constructor Detail

      • MethodCounter

        MethodCounter​(boolean inInterface)
        Creates an interface.
        Parameters:
        inInterface - indicated if counter for an interface. In which case, add all counts as public methods.
    • Method Detail

      • increment

        private void increment​(Scope scope)
        Increments to counter by one for the supplied scope.
        Parameters:
        scope - the scope counter to increment.
      • value

        private int value​(Scope scope)
        Gets the value of a scope counter.
        Parameters:
        scope - the scope counter to get the value of
        Returns:
        the value of a scope counter
      • getTotal

        private int getTotal()
        Fetches total number of methods.
        Returns:
        the total number of methods.