Class StringCounter

java.lang.Object
org.python.core.util.StringCounter

public class StringCounter extends Object
Not for application use, this class may be used to count how many times a String occurs a point in the runtime. We use this to investigate optimisations of the handling of strings in the runtime, principally to avoid checks for byte-nature where that is already known.
  • Constructor Details

    • StringCounter

      public StringCounter()
  • Method Details

    • count

      public void count(String s)
      Count this occurrence.
      Parameters:
      s - to count
    • top

      public Map<String,Integer> top(int n)
      Report the top n counts.
      Parameters:
      n - number of counts to retrieve
      Returns:
      counts of the top n strings.
    • top

      public void top(int n, PrintStream out)
      Report the top n counts.