Package org.python.core.util
Class StringCounter
- java.lang.Object
-
- org.python.core.util.StringCounter
-
public class StringCounter extends java.lang.Object
Not for application use, this class may be used to count how many times aString
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 Summary
Constructors Constructor Description StringCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
count(java.lang.String s)
Count this occurrence.java.util.Map<java.lang.String,java.lang.Integer>
top(int n)
Report the topn
counts.void
top(int n, java.io.PrintStream out)
Report the top n counts.
-
-
-
Method Detail
-
count
public void count(java.lang.String s)
Count this occurrence.- Parameters:
s
- to count
-
top
public java.util.Map<java.lang.String,java.lang.Integer> top(int n)
Report the topn
counts.- Parameters:
n
- number of counts to retrieve- Returns:
- counts of the top
n
strings.
-
top
public void top(int n, java.io.PrintStream out)
Report the top n counts.
-
-