All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bukkit.craftbukkit.scheduler.CraftAsyncDebugger Maven / Gradle / Ivy

package org.bukkit.craftbukkit.scheduler;

import org.bukkit.plugin.Plugin;


class CraftAsyncDebugger {
  private final int expiry;
  private final Plugin plugin;
  private final Class clazz;
  private CraftAsyncDebugger next = null;

  CraftAsyncDebugger(final int expiry, final Plugin plugin, final Class clazz) {
    this.expiry = expiry;
    this.plugin = plugin;
    this.clazz = clazz;

  }

  final CraftAsyncDebugger getNextHead(final int time) {
    CraftAsyncDebugger next, current = this;
    while (time > current.expiry && (next = current.next) != null) {
      current = next;
    }
    return current;
  }

  final CraftAsyncDebugger setNext(final CraftAsyncDebugger next) {
    return this.next = next;
  }

  StringBuilder debugTo(final StringBuilder string) {
    for (CraftAsyncDebugger next = this; next != null; next = next.next) {
      string.append(next.plugin.getDescription().getName()).append(':').append(next.clazz.getName()).append('@').append(next.expiry).append(',');
    }
    return string;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy