SystemGroup class

Пакет: com.hypixel.hytale.component

Файл: com/hypixel/hytale/component/SystemGroup.java

implements: Comparable<SystemGroup<ECS_TYPE>>

Поля (2)

МодификаторыТипИмя
int var1
SystemGroup var2

Методы (10)

МодификаторыВозвратСигнатура
abstract throw new IllegalArgumentExceptionthrow new IllegalArgumentException("SystemGroup is for a different registry! " + this)
abstract throw new IllegalStateExceptionthrow new IllegalStateException("SystemGroup is invalid!")
public int compareToint compareTo(@Nonnull SystemGroup<ECS_TYPE> var1)
public int getIndexint getIndex()
if if(this.invalidated)
if if(this == var1)
void invalidatevoid invalidate()
boolean isValidboolean isValid()
public void validatevoid validate()
public void validateRegistryvoid validateRegistry(@Nonnull ComponentRegistry<ECS_TYPE> var1)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.component;

class="kw">import com.hypixel.hytale.component.dependency.Dependency;
class="kw">import java.util.Set;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class SystemGroup<ECS_TYPE> class="kw">implements Comparable<SystemGroup<ECS_TYPE>> {
   @Nonnull
   class="kw">private class="kw">final ComponentRegistry<ECS_TYPE> registry;
   class="kw">private class="kw">final int index;
   @Nonnull
   class="kw">private class="kw">final Set<Dependency<ECS_TYPE>> dependencies;
   class="kw">private boolean invalidated;

   SystemGroup(@Nonnull ComponentRegistry<ECS_TYPE> var1, int var2, @Nonnull Set<Dependency<ECS_TYPE>> var3) {
      this.registry = var1;
      this.index = var2;
      this.dependencies = var3;
   }

   @Nonnull
   class="kw">public ComponentRegistry<ECS_TYPE> getRegistry() {
      class="kw">return this.registry;
   }

   @Nonnull
   class="kw">public Set<Dependency<ECS_TYPE>> getDependencies() {
      class="kw">return this.dependencies;
   }

   class="kw">public int getIndex() {
      class="kw">return this.index;
   }

   class="kw">public void validateRegistry(@Nonnull ComponentRegistry<ECS_TYPE> var1) {
      if (!this.registry.equals(var1)) {
         throw new IllegalArgumentException("SystemGroup is for a different registry! " + this);
      }
   }

   class="kw">public void validate() {
      if (this.invalidated) {
         throw new IllegalStateException("SystemGroup is invalid!");
      }
   }

   void invalidate() {
      this.invalidated = true;
   }

   boolean isValid() {
      class="kw">return !this.invalidated;
   }

   class="kw">public int compareTo(@Nonnull SystemGroup<ECS_TYPE> var1) {
      class="kw">return Integer.compare(this.index, var1.getIndex());
   }

   @Override
   class="kw">public boolean equals(@Nullable Object var1) {
      if (this == var1) {
         class="kw">return true;
      } else if (var1 != null && this.getClass() == var1.getClass()) {
         SystemGroup var2 = (SystemGroup<?>)var1;
         class="kw">return this.index != var2.index ? false : this.registry.equals(var2.registry);
      } else {
         class="kw">return false;
      }
   }

   @Override
   class="kw">public int hashCode() {
      int var1 = this.registry.hashCode();
      class="kw">return 31 * var1 + this.index;
   }

   @Nonnull
   @Override
   class="kw">public String toString() {
      class="kw">return "SystemGroup{registry=" + this.registry.getClass() + "@" + this.registry.hashCode() + ", index=" + this.index + "}";
   }
}