Class Member

java.lang.Object
net.codecrete.windowsapi.metadata.Member

public class Member extends Object
Member (field) of a struct or enumeration type.
  • Constructor Details

    • Member

      public Member(String name, int fieldIndex, Type type, Object value)
      Creates a new member instance.
      Parameters:
      name - member name
      fieldIndex - index within struct/enumeration
      type - member type
      value - member value
  • Method Details

    • name

      public String name()
      Gets the member name.
      Returns:
      the name
    • fieldIndex

      public int fieldIndex()
      Gets the field index.
      Returns:
      the index
    • type

      public Type type()
      Gets the member type.
      Returns:
      the type
    • value

      public Object value()
      Gets the member value.
      Returns:
      the value
    • offset

      public int offset()
      Gets the member offset within the struct.
      Returns:
      the offset (in bytes)
    • setOffset

      public void setOffset(int offset)
      Sets the member offset within the struct.
      Parameters:
      offset - the offset (in bytes)
    • paddingAfter

      public int paddingAfter()
      Sets the padding length after this member.
      Returns:
      the padding length (in bytes)
    • setPaddingAfter

      public void setPaddingAfter(int paddingAfter)
      Sets the padding length after this member.
      Parameters:
      paddingAfter - the padding length (in bytes)
    • isBitField

      public boolean isBitField()
      Indicates if this member is part of a C bitfield.
      Returns:
      true if it is part of a bitfield, false otherwise
    • duplicate

      public Member duplicate(UnaryOperator<Type> typeReplacer)
      Creates a copy of this member, replacing its type.
      Parameters:
      typeReplacer - lambda providing the target type for the current type
      Returns:
      the member copy