PaletteSetProvider class

Пакет: com.hypixel.hytale.server.core.universe.world.chunk.section.palette

Файл: com/hypixel/hytale/server/core/universe/world/chunk/section/palette/PaletteSetProvider.java

Поля (1)

МодификаторыТипИмя
final ThreadLocal<PaletteSetProvider> LOCAL

Методы (3)

МодификаторыВозвратСигнатура
static PaletteSetProvider getPaletteSetProvider get()
public ByteSet getByteSetByteSet getByteSet(int var1)
public ShortSet getShortSetShortSet getShortSet(int var1)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.universe.world.chunk.section.palette;

class="kw">import it.unimi.dsi.fastutil.bytes.ByteOpenHashSet;
class="kw">import it.unimi.dsi.fastutil.bytes.ByteSet;
class="kw">import it.unimi.dsi.fastutil.shorts.ShortOpenHashSet;
class="kw">import it.unimi.dsi.fastutil.shorts.ShortSet;

class="kw">public class PaletteSetProvider {
   class="kw">private class="kw">static class="kw">final ThreadLocal<PaletteSetProvider> LOCAL = ThreadLocal.withInitial(PaletteSetProvider::new);
   class="kw">private class="kw">final ByteOpenHashSet byteHashSet = new ByteOpenHashSet();
   class="kw">private class="kw">final ShortOpenHashSet shortHashSet = new ShortOpenHashSet();

   class="kw">public PaletteSetProvider() {
   }

   class="kw">public ByteSet getByteSet(int var1) {
      this.byteHashSet.clear();
      this.byteHashSet.ensureCapacity(var1);
      class="kw">return this.byteHashSet;
   }

   class="kw">public ShortSet getShortSet(int var1) {
      this.shortHashSet.clear();
      this.shortHashSet.ensureCapacity(var1);
      class="kw">return this.shortHashSet;
   }

   class="kw">protected class="kw">static PaletteSetProvider get() {
      class="kw">return LOCAL.get();
   }
}