Class Counter

    • Constructor Detail

      • Counter

        public Counter()
    • Method Detail

      • inc

        public void inc()
        Increment the counter by one.
      • inc

        public void inc​(long n)
        Increment the counter by n.
        Parameters:
        n - the amount by which the counter will be increased
      • dec

        public void dec()
        Decrement the counter by one.
      • dec

        public void dec​(long n)
        Decrement the counter by n.
        Parameters:
        n - the amount by which the counter will be decreased
      • getCount

        public long getCount()
        Returns the counter's current value.
        Specified by:
        getCount in interface Counting
        Returns:
        the counter's current value