Class Resolution.Ratio

Direct Known Subclasses:
Resolution.Ratio16x10, Resolution.Ratio16x9, Resolution.Ratio4x3, Resolution.Ratio5x4
Enclosing class:
Resolution

public static class Resolution.Ratio
Describes an aspect ratio used to categorize Resolution instances. The ratio consists of a name and the x:y components.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Ratio(int x, int y)
    Constructs a new Ratio with the given components.
    protected
    Ratio(int x, int y, String name)
    Constructs a new Ratio with the given components and explicit name.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static List<Resolution>
    getAll(Class<?> clz)
    Collects all public static Resolution fields declared on the supplied class.
    Gets the name of this aspect ratio
    int
    Gets the x-value of this aspect ratio.
    int
    Gets the y-value of this aspect ratio.
     

    Methods inherited from class Object

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

    • Ratio

      protected Ratio(int x, int y)
      Constructs a new Ratio with the given components. The name defaults to "x:y".
      Parameters:
      x - the x component of the ratio
      y - the y component of the ratio
    • Ratio

      protected Ratio(int x, int y, String name)
      Constructs a new Ratio with the given components and explicit name.
      Parameters:
      x - the x component of the ratio
      y - the y component of the ratio
      name - the display name of the ratio
  • Method Details

    • getAll

      protected static List<Resolution> getAll(Class<?> clz)
      Collects all public static Resolution fields declared on the supplied class.
      Parameters:
      clz - the class whose declared Resolution fields will be returned
      Returns:
      all matching resolutions
    • getName

      public String getName()
      Gets the name of this aspect ratio
      Returns:
      The name of this aspect ratio.
    • getX

      public int getX()
      Gets the x-value of this aspect ratio.
      Returns:
      The x-value of this aspect ratio.
    • getY

      public int getY()
      Gets the y-value of this aspect ratio.
      Returns:
      The y-value of this aspect ratio.
    • toString

      public String toString()
      Overrides:
      toString in class Object