Class Size


  • public final class Size
    extends Object
    Immutable class for describing width and height dimensions in pixels.
    • Field Detail

      • UNKNOWN

        public static final Size UNKNOWN
        A static instance to represent an unknown size value.
    • Constructor Detail

      • Size

        public Size​(int width,
                    int height)
        Creates a new immutable Size instance.
        Parameters:
        width - The width of the size, in pixels, or C.LENGTH_UNSET if unknown.
        height - The height of the size, in pixels, or C.LENGTH_UNSET if unknown.
        Throws:
        IllegalArgumentException - if an invalid width or height is specified.
    • Method Detail

      • getWidth

        public int getWidth()
        Returns the width of the size (in pixels), or C.LENGTH_UNSET if unknown.
      • getHeight

        public int getHeight()
        Returns the height of the size (in pixels), or C.LENGTH_UNSET if unknown.
      • equals

        public boolean equals​(@Nullable
                              Object obj)
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object