Package com.jackmeng.stl
Class stl_SimpleSampler<T>
java.lang.Object
com.jackmeng.stl.stl_SimpleSampler<T>
- All Implemented Interfaces:
java.util.function.Consumer<T>
public class stl_SimpleSampler<T>
extends java.lang.Object
implements java.util.function.Consumer<T>
-
Field Summary
Fields Modifier and Type Field Description private stl_Callback<java.lang.Void,T>
callback
private int
counter
private int
sampleRate
-
Constructor Summary
Constructors Constructor Description stl_SimpleSampler(int sampleRate, stl_Callback<java.lang.Void,T> callback)
-
Method Summary
Modifier and Type Method Description void
accept(T t)
static void
sampleFile(java.lang.String filePath, int sampleRate, stl_Callback<java.lang.Void,java.lang.String> callback)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.Consumer
andThen
-
Field Details
-
sampleRate
private final int sampleRate -
counter
private int counter -
callback
-
-
Constructor Details
-
stl_SimpleSampler
-
-
Method Details
-
accept
- Specified by:
accept
in interfacejava.util.function.Consumer<T>
-
sampleFile
public static void sampleFile(java.lang.String filePath, int sampleRate, stl_Callback<java.lang.Void,java.lang.String> callback) throws java.io.IOException- Throws:
java.io.IOException
-