Record Class Pow2BitArray

java.lang.Object
java.lang.Record
ac.boar.anticheat.util.geyser.Pow2BitArray
Record Components:
version - Palette version information
size - Number of entries in this palette (not the length of the words array that internally backs this palette)
words - Array used to store data
All Implemented Interfaces:
BitArray

public record Pow2BitArray(BitArrayVersion version, int size, int[] words) extends Record implements BitArray
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pow2BitArray(BitArrayVersion version, int size, int[] words)
    Creates an instance of a Pow2BitArray record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    get(int index)
    Gets the entry at the given index
    final int
    Returns a hash code value for this object.
    void
    set(int index, int value)
    Sets the entry at the given location to the given value
    int
    Gets the long array that is used to store the data in this BitArray.
    final String
    Returns a string representation of this record class.
    Returns the value of the version record component.
    int[]

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface ac.boar.anticheat.util.geyser.BitArray

    writeSizeToNetwork
  • Constructor Details

    • Pow2BitArray

      public Pow2BitArray(BitArrayVersion version, int size, int[] words)
      Creates an instance of a Pow2BitArray record class.
      Parameters:
      version - the value for the version record component
      size - the value for the size record component
      words - the value for the words record component
  • Method Details

    • set

      public void set(int index, int value)
      Sets the entry at the given location to the given value
      Specified by:
      set in interface BitArray
    • get

      public int get(int index)
      Gets the entry at the given index
      Specified by:
      get in interface BitArray
    • size

      public int size()
      Gets the long array that is used to store the data in this BitArray. This is useful for sending packet data.
      Specified by:
      size in interface BitArray
    • words

      public int[] words()
      Specified by:
      words in interface BitArray
      Returns:
    • copy

      public BitArray copy()
      Specified by:
      copy in interface BitArray
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • version

      public BitArrayVersion version()
      Returns the value of the version record component.
      Specified by:
      version in interface BitArray
      Returns:
      the value of the version record component