Record Class ElementLayout.Height

java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.page.ElementLayout.Height
Enclosing class:
ElementLayout

public static record ElementLayout.Height(ElementLayout.Height.Kind kind, int pixels, float percent) extends Record
How tall an element's box is: ElementLayout.Height.Kind.FILL the rest of the page, ElementLayout.Height.Kind.FIT only as tall as what it holds (up to the rest of the page), ElementLayout.Height.Kind.FIXED that many pixels, or ElementLayout.Height.Kind.PERCENT that share of the page's content.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Height(ElementLayout.Height.Kind kind, int pixels)
     
    Height(ElementLayout.Height.Kind kind, int pixels, float percent)
    Creates an instance of a Height record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the kind record component.
    float
    Returns the value of the percent record component.
    int
    Returns the value of the pixels record component.
    int
    pixels(int full)
    How many pixels it is on a page whose content is full pixels tall.
    boolean
    Whether it is a size of its own (pixels, or a share of the page), not the rest of the page or its content's.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • Height

      public Height(ElementLayout.Height.Kind kind, int pixels)
    • Height

      public Height(ElementLayout.Height.Kind kind, int pixels, float percent)
      Creates an instance of a Height record class.
      Parameters:
      kind - the value for the kind record component
      pixels - the value for the pixels record component
      percent - the value for the percent record component
  • Method Details

    • sized

      public boolean sized()
      Whether it is a size of its own (pixels, or a share of the page), not the rest of the page or its content's.
    • pixels

      public int pixels(int full)
      How many pixels it is on a page whose content is full pixels tall.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • kind

      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • pixels

      public int pixels()
      Returns the value of the pixels record component.
      Returns:
      the value of the pixels record component
    • percent

      public float percent()
      Returns the value of the percent record component.
      Returns:
      the value of the percent record component