Record Class FileData

java.lang.Object
java.lang.Record
io.github.mwttg.wavefront.extractor.FileData

public record FileData(List<org.joml.Vector3f> vertices, List<org.joml.Vector2f> textureCoordinates, List<org.joml.Vector3f> normals, List<Triangle> faces) extends Record
The internal data structure, created from parsing the .obj file.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileData​(List<org.joml.Vector3f> vertices, List<org.joml.Vector2f> textureCoordinates, List<org.joml.Vector3f> normals, List<Triangle> faces)
    Creates an instance of a FileData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals​(Object o)
    Indicates whether some other object is "equal to" this one.
    Returns the value of the faces record component.
    int
    Returns a hash code value for this object.
    List<org.joml.Vector3f>
    Returns the value of the normals record component.
    List<org.joml.Vector2f>
    Returns the value of the textureCoordinates record component.
    Returns a string representation of this record class.
    List<org.joml.Vector3f>
    Returns the value of the vertices record component.

    Methods inherited from class java.lang.Object

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

    • FileData

      public FileData(List<org.joml.Vector3f> vertices, List<org.joml.Vector2f> textureCoordinates, List<org.joml.Vector3f> normals, List<Triangle> faces)
      Creates an instance of a FileData record class.
      Parameters:
      vertices - the value for the vertices record component
      textureCoordinates - the value for the textureCoordinates record component
      normals - the value for the normals record component
      faces - the value for the faces record component
  • Method Details

    • 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 Objects::equals(Object,Object).
      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.
    • vertices

      public List<org.joml.Vector3f> vertices()
      Returns the value of the vertices record component.
      Returns:
      the value of the vertices record component
    • textureCoordinates

      public List<org.joml.Vector2f> textureCoordinates()
      Returns the value of the textureCoordinates record component.
      Returns:
      the value of the textureCoordinates record component
    • normals

      public List<org.joml.Vector3f> normals()
      Returns the value of the normals record component.
      Returns:
      the value of the normals record component
    • faces

      public List<Triangle> faces()
      Returns the value of the faces record component.
      Returns:
      the value of the faces record component