Class MaskMemoizer

java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.MaskMemoizer
All Implemented Interfaces:
Mask, AutoCloseable

public class MaskMemoizer extends AbstractMask implements AutoCloseable
A utility mask wrapper that memoizes the results of the given mask.

This should not be kept around long-term for memory usage reasons. It's intended for usage within a single operation. The function is auto-closeable to make this simpler.

  • Constructor Details

    • MaskMemoizer

      public MaskMemoizer(Mask mask)
  • Method Details

    • test

      public boolean test(BlockVector3 vector)
      Description copied from interface: Mask
      Returns true if the criteria is met.
      Specified by:
      test in interface Mask
      Parameters:
      vector - the vector to test
      Returns:
      true if the criteria is met
    • clear

      public void clear()
    • toMask2D

      public Mask2D toMask2D()
      Description copied from interface: Mask
      Get the 2D version of this mask if one exists.
      Specified by:
      toMask2D in interface Mask
      Returns:
      a 2D mask version or null if this mask can't be 2D
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception