Record Class ZoomValue

java.lang.Object
java.lang.Record
org.jjazz.pianoroll.api.ZoomValue

public record ZoomValue(int hValue, int vValue) extends Record
Zoom value for an editor.

hValue and vValue must be in the range [0;100].

  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a zoom value with 50 / 50.
    ZoomValue(int hValue, int vValue)
    Creates an instance of a ZoomValue record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    getCopy(int hDelta, int vDelta)
    Get a copy with the specified parameters added to the existing hValue and vValue.
    getHCopy(int newHValue)
    Get a copy of this instance with hValue changed.
    getVCopy(int newVValue)
    Get a copy of this instance with vValue changed.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the hValue record component.
    static ZoomValue
    Get a ZoomValue instance from the specified string.
    Save the object as a string.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the vValue record component.

    Methods inherited from class java.lang.Object

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

    • ZoomValue

      public ZoomValue()
      Create a zoom value with 50 / 50.
    • ZoomValue

      public ZoomValue(int hValue, int vValue)
      Creates an instance of a ZoomValue record class.
      Parameters:
      hValue - the value for the hValue record component
      vValue - the value for the vValue record component
  • Method Details

    • getHCopy

      public ZoomValue getHCopy(int newHValue)
      Get a copy of this instance with hValue changed.
      Parameters:
      newHValue -
      Returns:
    • getVCopy

      public ZoomValue getVCopy(int newVValue)
      Get a copy of this instance with vValue changed.
      Parameters:
      newVValue -
      Returns:
    • getCopy

      public ZoomValue getCopy(int hDelta, int vDelta)
      Get a copy with the specified parameters added to the existing hValue and vValue.
      Parameters:
      hDelta -
      vDelta -
      Returns:
    • saveAsString

      public String saveAsString()
      Save the object as a string.
      Returns:
      See Also:
    • loadFromString

      public static ZoomValue loadFromString(String s)
      Get a ZoomValue instance from the specified string.
      Parameters:
      s -
      Returns:
      See Also:
    • 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 '=='.
      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.
    • hValue

      public int hValue()
      Returns the value of the hValue record component.
      Returns:
      the value of the hValue record component
    • vValue

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