Class CachedMapper<K,V>

java.lang.Object
net.minecraft.util.CachedMapper<K,V>

public class CachedMapper<K,V> extends Object
A mapper that caches the latest input-output pair, so that repeated calls with the same argument do not call the expensive mapper function.
See Also:
Mappings:
Namespace Name
named net/minecraft/util/CachedMapper
intermediary net/minecraft/class_8105
official ayw
  • Field Details

    • mapper

      private final Function<K,V> mapper
      Mappings:
      Namespace Name Mixin selector
      named mapper Lnet/minecraft/util/CachedMapper;mapper:Ljava/util/function/Function;
      intermediary field_42269 Lnet/minecraft/class_8105;field_42269:Ljava/util/function/Function;
      official a Layw;a:Ljava/util/function/Function;
    • cachedInput

      @Nullable private K cachedInput
      Mappings:
      Namespace Name Mixin selector
      named cachedInput Lnet/minecraft/util/CachedMapper;cachedInput:Ljava/lang/Object;
      intermediary field_42270 Lnet/minecraft/class_8105;field_42270:Ljava/lang/Object;
      official b Layw;b:Ljava/lang/Object;
    • cachedOutput

      @Nullable private V cachedOutput
      Mappings:
      Namespace Name Mixin selector
      named cachedOutput Lnet/minecraft/util/CachedMapper;cachedOutput:Ljava/lang/Object;
      intermediary field_42271 Lnet/minecraft/class_8105;field_42271:Ljava/lang/Object;
      official c Layw;c:Ljava/lang/Object;
  • Constructor Details

    • CachedMapper

      public CachedMapper(Function<K,V> mapper)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/CachedMapper;<init>(Ljava/util/function/Function;)V
      intermediary <init> Lnet/minecraft/class_8105;<init>(Ljava/util/function/Function;)V
      official <init> Layw;<init>(Ljava/util/function/Function;)V
  • Method Details

    • map

      public V map(K input)
      Returns the mapped input.
      Returns:
      the mapped input
      Mappings:
      Namespace Name Mixin selector
      named map Lnet/minecraft/util/CachedMapper;map(Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_48782 Lnet/minecraft/class_8105;method_48782(Ljava/lang/Object;)Ljava/lang/Object;
      official a Layw;a(Ljava/lang/Object;)Ljava/lang/Object;