Record Class CodedIndex

java.lang.Object
java.lang.Record
net.codecrete.windowsapi.winmd.tables.CodedIndex
Record Components:
table - table number (see MetadataTables)
index - row index

public record CodedIndex(int table, int index) extends Record
Structured coded index consisting of table and row index.

See ECMA-335, II.24.2.6 #~ stream

  • Constructor Summary

    Constructors
    Constructor
    Description
    CodedIndex(int table, int index)
    Creates an instance of a CodedIndex record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static CodedIndex
    decode(int rawIndex, int[] tables)
    Creates a new instance by decoding the index value for a coded index for the given list of tables.
    static int
    encode(int table, int index, int[] tables)
    Encodes the table and index into an integer number for the given list of tables.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the index record component.
    boolean
    Indicates if the coded index represents a null value.
    int
    Returns the value of the table record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CodedIndex

      public CodedIndex(int table, int index)
      Creates an instance of a CodedIndex record class.
      Parameters:
      table - the value for the table record component
      index - the value for the index record component
  • Method Details

    • decode

      public static CodedIndex decode(int rawIndex, int[] tables)
      Creates a new instance by decoding the index value for a coded index for the given list of tables.
      Parameters:
      rawIndex - the raw index value
      tables - the tables participating in the coded index
      Returns:
      a new instance
    • encode

      public static int encode(int table, int index, int[] tables)
      Encodes the table and index into an integer number for the given list of tables.
      Parameters:
      table - table index
      index - row index
      tables - table indexes, in the order specified by the standard.
      Returns:
      coded index (as a number)
    • isNull

      public boolean isNull()
      Indicates if the coded index represents a null value.
      Returns:
      true if the index is a null value, false otherwise
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • table

      public int table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component