ProfilerFiller.java

net.minecraft.util.profiling.ProfilerFiller

信息

  • 全限定名:net.minecraft.util.profiling.ProfilerFiller
  • 类型:public interface
  • 包:net.minecraft.util.profiling
  • 源码路径:src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
  • 起始行号:L6
  • 职责:

    TODO

字段/常量

  • ROOT
    • 类型: String
    • 修饰符: package-private
    • 源码定位: L7
    • 说明:

      TODO

内部类/嵌套类型

  • net.minecraft.util.profiling.ProfilerFiller.CombinedProfileFiller
    • 类型: class
    • 修饰符: public static
    • 源码定位: L64
    • 说明:

      TODO

构造器

方法

下面的方法块按源码顺序生成。

void startTick() @ L9

  • 方法名:startTick
  • 源码定位:L9
  • 返回类型:void
  • 修饰符:package-private

参数:

说明:

TODO

void endTick() @ L11

  • 方法名:endTick
  • 源码定位:L11
  • 返回类型:void
  • 修饰符:package-private

参数:

说明:

TODO

void push(String name) @ L13

  • 方法名:push
  • 源码定位:L13
  • 返回类型:void
  • 修饰符:package-private

参数:

  • name: String

说明:

TODO

void push(Supplier<String> name) @ L15

  • 方法名:push
  • 源码定位:L15
  • 返回类型:void
  • 修饰符:package-private

参数:

  • name: Supplier

说明:

TODO

void pop() @ L17

  • 方法名:pop
  • 源码定位:L17
  • 返回类型:void
  • 修饰符:package-private

参数:

说明:

TODO

void popPush(String name) @ L19

  • 方法名:popPush
  • 源码定位:L19
  • 返回类型:void
  • 修饰符:package-private

参数:

  • name: String

说明:

TODO

void popPush(Supplier<String> name) @ L21

  • 方法名:popPush
  • 源码定位:L21
  • 返回类型:void
  • 修饰符:package-private

参数:

  • name: Supplier

说明:

TODO

default void addZoneText(String text) @ L23

  • 方法名:addZoneText
  • 源码定位:L23
  • 返回类型:void
  • 修饰符:default

参数:

  • text: String

说明:

TODO

default void addZoneValue(long value) @ L26

  • 方法名:addZoneValue
  • 源码定位:L26
  • 返回类型:void
  • 修饰符:default

参数:

  • value: long

说明:

TODO

default void setZoneColor(int color) @ L29

  • 方法名:setZoneColor
  • 源码定位:L29
  • 返回类型:void
  • 修饰符:default

参数:

  • color: int

说明:

TODO

default Zone zone(String name) @ L32

  • 方法名:zone
  • 源码定位:L32
  • 返回类型:Zone
  • 修饰符:default

参数:

  • name: String

说明:

TODO

default Zone zone(Supplier<String> name) @ L37

  • 方法名:zone
  • 源码定位:L37
  • 返回类型:Zone
  • 修饰符:default

参数:

  • name: Supplier

说明:

TODO

void markForCharting(MetricCategory category) @ L42

  • 方法名:markForCharting
  • 源码定位:L42
  • 返回类型:void
  • 修饰符:package-private

参数:

  • category: MetricCategory

说明:

TODO

default void incrementCounter(String name) @ L44

  • 方法名:incrementCounter
  • 源码定位:L44
  • 返回类型:void
  • 修饰符:default

参数:

  • name: String

说明:

TODO

void incrementCounter(String name, int amount) @ L48

  • 方法名:incrementCounter
  • 源码定位:L48
  • 返回类型:void
  • 修饰符:package-private

参数:

  • name: String
  • amount: int

说明:

TODO

default void incrementCounter(Supplier<String> name) @ L50

  • 方法名:incrementCounter
  • 源码定位:L50
  • 返回类型:void
  • 修饰符:default

参数:

  • name: Supplier

说明:

TODO

void incrementCounter(Supplier<String> name, int amount) @ L54

  • 方法名:incrementCounter
  • 源码定位:L54
  • 返回类型:void
  • 修饰符:package-private

参数:

  • name: Supplier
  • amount: int

说明:

TODO

static ProfilerFiller combine(ProfilerFiller first, ProfilerFiller second) @ L56

  • 方法名:combine
  • 源码定位:L56
  • 返回类型:ProfilerFiller
  • 修饰符:static

参数:

  • first: ProfilerFiller
  • second: ProfilerFiller

说明:

TODO

代码

public interface ProfilerFiller {
    String ROOT = "root";
 
    void startTick();
 
    void endTick();
 
    void push(String name);
 
    void push(Supplier<String> name);
 
    void pop();
 
    void popPush(String name);
 
    void popPush(Supplier<String> name);
 
    default void addZoneText(String text) {
    }
 
    default void addZoneValue(long value) {
    }
 
    default void setZoneColor(int color) {
    }
 
    default Zone zone(String name) {
        this.push(name);
        return new Zone(this);
    }
 
    default Zone zone(Supplier<String> name) {
        this.push(name);
        return new Zone(this);
    }
 
    void markForCharting(MetricCategory category);
 
    default void incrementCounter(String name) {
        this.incrementCounter(name, 1);
    }
 
    void incrementCounter(String name, int amount);
 
    default void incrementCounter(Supplier<String> name) {
        this.incrementCounter(name, 1);
    }
 
    void incrementCounter(Supplier<String> name, int amount);
 
    static ProfilerFiller combine(ProfilerFiller first, ProfilerFiller second) {
        if (first == InactiveProfiler.INSTANCE) {
            return second;
        } else {
            return (ProfilerFiller)(second == InactiveProfiler.INSTANCE ? first : new ProfilerFiller.CombinedProfileFiller(first, second));
        }
    }
 
    public static class CombinedProfileFiller implements ProfilerFiller {
        private final ProfilerFiller first;
        private final ProfilerFiller second;
 
        public CombinedProfileFiller(ProfilerFiller first, ProfilerFiller second) {
            this.first = first;
            this.second = second;
        }
 
        @Override
        public void startTick() {
            this.first.startTick();
            this.second.startTick();
        }
 
        @Override
        public void endTick() {
            this.first.endTick();
            this.second.endTick();
        }
 
        @Override
        public void push(String name) {
            this.first.push(name);
            this.second.push(name);
        }
 
        @Override
        public void push(Supplier<String> name) {
            this.first.push(name);
            this.second.push(name);
        }
 
        @Override
        public void markForCharting(MetricCategory category) {
            this.first.markForCharting(category);
            this.second.markForCharting(category);
        }
 
        @Override
        public void pop() {
            this.first.pop();
            this.second.pop();
        }
 
        @Override
        public void popPush(String name) {
            this.first.popPush(name);
            this.second.popPush(name);
        }
 
        @Override
        public void popPush(Supplier<String> name) {
            this.first.popPush(name);
            this.second.popPush(name);
        }
 
        @Override
        public void incrementCounter(String name, int amount) {
            this.first.incrementCounter(name, amount);
            this.second.incrementCounter(name, amount);
        }
 
        @Override
        public void incrementCounter(Supplier<String> name, int amount) {
            this.first.incrementCounter(name, amount);
            this.second.incrementCounter(name, amount);
        }
 
        @Override
        public void addZoneText(String text) {
            this.first.addZoneText(text);
            this.second.addZoneText(text);
        }
 
        @Override
        public void addZoneValue(long value) {
            this.first.addZoneValue(value);
            this.second.addZoneValue(value);
        }
 
        @Override
        public void setZoneColor(int color) {
            this.first.setZoneColor(color);
            this.second.setZoneColor(color);
        }
    }
}

引用的其他类

  • Zone

    • 引用位置: 构造调用/返回值
    • 关联成员: Zone()
  • MetricCategory

    • 引用位置: 参数