Module javafx.graphics
Package javafx.css

## Class Size

- java.lang.Object
- - javafx.css.Size

-     public final class Size
      extends Object

  Represents a size specified in a particular unit, such as 14px or 0.2em.
  Since:
    9

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Size​(double value, SizeUnits units)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object obj)` |
    `SizeUnits` | `getUnits()` | Return the units
    `double` | `getValue()` | Return the value
    `int` | `hashCode()` |
    `boolean` | `isAbsolute()` | Return whether or not this Size is an absolute value or a relative value.
    `double` | `pixels()` | A convenience method for calling `pixels(1)`
    `double` | `pixels​(double multiplier, Font font)` | Convert this size into pixels
    `double` | `pixels​(Font font)` | If size is not an absolute size, return the product of font size in pixels and value.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Size

          public Size​(double value,
                      SizeUnits units)

  - ### Method Detail

    - #### getValue

          public double getValue()

      Return the value
      Returns:
        the value

    - #### getUnits

          public SizeUnits getUnits()

      Return the units
      Returns:
        the units

    - #### isAbsolute

          public boolean isAbsolute()

      Return whether or not this Size is an absolute value or a relative value.
      Returns:
        true if it is absolute, otherwise false

    - #### pixels

          public double pixels​(double multiplier,
                               Font font)

      Convert this size into pixels
      Parameters:
        `multiplier` - The multiplier for PERCENTAGE sizes
        `font` - The font for EM sizes
      Returns:
        the size in pixels

    - #### pixels

          public double pixels​(Font font)

      If size is not an absolute size, return the product of font size in pixels and value. Otherwise, return the absolute value.
      Parameters:
        `font` - the font
      Returns:
        the size of pixels

    - #### pixels

          public double pixels()

      A convenience method for calling `pixels(1)`
      Returns:
        the size in pixels

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals​(Object obj)

      Overrides:
        `equals` in class `Object`