java.lang.Object
java.lang.Record
org.variantsync.diffdetective.show.engine.geom.Box

public record Box(Vec2 upperLeft, Vec2 lowerRight) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Vec2
    The field for the lowerRight record component.
    private final Vec2
    The field for the upperLeft record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Box(Vec2 upperLeft, double width, double height)
     
    Box(Vec2 upperLeft, Vec2 lowerRight)
    Creates an instance of a Box record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
     
    double
     
    final int
    Returns a hash code value for this object.
    Returns the value of the lowerRight record component.
    shrink(double delta)
     
    shrink(Vec2 delta)
     
    Returns a string representation of this record class.
    Returns the value of the upperLeft record component.

    Methods inherited from class java.lang.Object

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

    • upperLeft

      private final Vec2 upperLeft
      The field for the upperLeft record component.
    • lowerRight

      private final Vec2 lowerRight
      The field for the lowerRight record component.
  • Constructor Details

    • Box

      public Box(Vec2 upperLeft, double width, double height)
    • Box

      public Box(Vec2 upperLeft, Vec2 lowerRight)
      Creates an instance of a Box record class.
      Parameters:
      upperLeft - the value for the upperLeft record component
      lowerRight - the value for the lowerRight record component
  • Method Details

    • getWidth

      public double getWidth()
    • getHeight

      public double getHeight()
    • shrink

      public Box shrink(Vec2 delta)
    • shrink

      public Box shrink(double delta)
    • toString

      public 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.
    • upperLeft

      public Vec2 upperLeft()
      Returns the value of the upperLeft record component.
      Returns:
      the value of the upperLeft record component
    • lowerRight

      public Vec2 lowerRight()
      Returns the value of the lowerRight record component.
      Returns:
      the value of the lowerRight record component