java.lang.Object
de.powerstat.validation.values.DisplayAspectRatio
- All Implemented Interfaces:
IValueObject,Comparable<DisplayAspectRatio>
public final class DisplayAspectRatio
extends Object
implements Comparable<DisplayAspectRatio>, IValueObject
Display aspect ratio.
1:1 2.1:1 3:1 3:2 4:3 5:3 5:4 8:5 9:5 10:6 15:9 16:9 16:10 17:10 25:12 25:16 60:29 64:35 72:35
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare with another object.booleanIs equal with another object.intgetX()Get display x size.intgetY()Get display y size.inthashCode()Calculate hash code.static DisplayAspectRatioof(int x, int y) Display aspect ration factory.static DisplayAspectRatioDisplay aspect ration factory.Returns the value of this DisplayAspectRatio as a string.toString()Returns the string representation of this DisplayAspectRatio.
-
Field Details
-
x
private final int xDisplay x size (1-72). -
y
private final int yDisplay y size (1-35).
-
-
Constructor Details
-
DisplayAspectRatio
private DisplayAspectRatio(int x, int y) Constructor.- Parameters:
x- Display x site (1-72)y- Display y size (1-35)
-
-
Method Details
-
of
Display aspect ration factory.- Parameters:
x- Display x site (1-72)y- Display y size (1-35)- Returns:
- DisplayAspectRatio object
-
of
Display aspect ration factory.- Parameters:
value- String value of type x:y- Returns:
- DisplayAspectRatio object
- Throws:
IllegalArgumentException- If not of correct format
-
getX
public int getX()Get display x size.- Returns:
- X size
-
getY
public int getY()Get display y size.- Returns:
- Y size
-
stringValue
Returns the value of this DisplayAspectRatio as a string.- Specified by:
stringValuein interfaceIValueObject- Returns:
- The text value represented by this object after conversion to type string.
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
toString
Returns the string representation of this DisplayAspectRatio. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "DisplayAspectRatio[x=1, y=1]" -
compareTo
Compare with another object.- Specified by:
compareToin interfaceComparable<DisplayAspectRatio>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-