public class CSpeed extends Object
限定符和类型 | 字段和说明 |
---|---|
private static Map<String,AbstractRecorder> |
recorders |
构造器和说明 |
---|
CSpeed() |
限定符和类型 | 方法和说明 |
---|---|
static <T extends AbstractRecorder> |
addRecorder(T recorder)
往列表中添加一个记录器
|
static AbstractRecorder |
getRecorder(AbstractRecorder recorder)
如果指定名称的记录器不存在,则使用指定的记录器创建。
|
static AbstractRecorder |
getRecorder(Class clazz)
传入Class,通过class取得类名作为记录器名称,调用getRecorder(String)进行getRecorder操作
|
static AbstractRecorder |
getRecorder(String name)
传入记录器名称,如果记录器已经存在,则直接get
|
static void |
remove(Recorder recorder)
删除计速器
|
private static Map<String,AbstractRecorder> recorders
public static AbstractRecorder getRecorder(Class clazz)
clazz
- 类public static AbstractRecorder getRecorder(String name)
name
- 记录器名称public static AbstractRecorder getRecorder(AbstractRecorder recorder)
recorder
- Recorder记录器对象public static void remove(Recorder recorder)
recorder
- 待删除的计速器public static <T extends AbstractRecorder> T addRecorder(T recorder)
recorder
- 记录器Copyright © 2020. All rights reserved.