org.python.core.util
Class StringCounter
- java.lang.Object
-
- org.python.core.util.StringCounter
-
public class StringCounter extends java.lang.ObjectNot for application use, this class may be used to count how many times aStringoccurs 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 and Description StringCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcount(java.lang.String s)Count this occurrence.java.util.Map<java.lang.String,java.lang.Integer>top(int n)Report the topncounts.voidtop(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 topncounts.- Parameters:
n- number of counts to retrieve- Returns:
- counts of the top
nstrings.
-
top
public void top(int n, java.io.PrintStream out)Report the top n counts.
-
-
DMelt 3.0 © DataMelt by jWork.ORG