Class Counter

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Counter()
      Hidden constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.CharSequence,​java.lang.Integer> of​(java.lang.CharSequence[] tokens)
      Counts how many times each element provided occurred in an array and returns a dict with the element as key and the count as value.
      • Methods inherited from class java.lang.Object

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

      • Counter

        private Counter()
        Hidden constructor.
    • Method Detail

      • of

        public static java.util.Map<java.lang.CharSequence,​java.lang.Integer> of​(java.lang.CharSequence[] tokens)
        Counts how many times each element provided occurred in an array and returns a dict with the element as key and the count as value.
        Parameters:
        tokens - array of tokens
        Returns:
        dict, where the elements are key, and the count the value