public class AspectRatio extends java.lang.Object implements java.lang.Comparable<AspectRatio>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AspectRatio another) |
boolean |
equals(java.lang.Object o) |
int |
getX() |
int |
getY() |
int |
hashCode() |
AspectRatio |
inverse() |
boolean |
matches(Size size) |
static AspectRatio |
of(int x,
int y)
Creates an aspect ratio with the given values.
|
static AspectRatio |
parse(java.lang.String string)
Parses an aspect ratio string, for example those previously obtained
with
toString(). |
float |
toFloat() |
java.lang.String |
toString() |
public static AspectRatio of(int x, int y)
x - the widthy - the heightpublic static AspectRatio parse(@NonNull java.lang.String string)
toString().string - a string of the format x:y where x and y are integerspublic int getX()
public int getY()
public boolean matches(Size size)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic float toFloat()
public int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(@NonNull
AspectRatio another)
compareTo in interface java.lang.Comparable<AspectRatio>public AspectRatio inverse()