Package com.pspdfkit.utils
Class Size
-
- All Implemented Interfaces:
-
android.os.Parcelable
,java.lang.Comparable
public class Size implements Comparable<T>, Parcelable
Data structure representing a size.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<Size>
CREATOR
public final float
width
public final float
height
-
Constructor Summary
Constructors Constructor Description Size(float width, float height)
Creates a size representation.
-
Method Summary
Modifier and Type Method Description boolean
isPortrait()
Check if size has portrait orientation. RectF
toRect()
Expresses this size as (0, 0, width, height) rect. RectF
toRect(@Nullable() RectF reusableeRect)
Expresses this size as (0, 0, width, height) rect. Size
toPortrait()
Create size in portrait orientation. Size
toLandscape()
Create size in landscape orientation. int
hashCode()
boolean
equals(Object o)
String
toString()
int
compareTo(@NonNull() Size another)
int
describeContents()
void
writeToParcel(Parcel dest, int flags)
-
-
Method Detail
-
isPortrait
boolean isPortrait()
Check if size has portrait orientation.
- Returns:
true if
height >= width
-
toRect
@NonNull() RectF toRect(@Nullable() RectF reusableeRect)
Expresses this size as (0, 0, width, height) rect.
-
toPortrait
@NonNull() Size toPortrait()
Create size in portrait orientation.
- Returns:
Copy of this size in portrait orientation (width <= height).
-
toLandscape
@NonNull() Size toLandscape()
Create size in landscape orientation.
- Returns:
Copy of this size in landscape orientation (width >height).
-
hashCode
int hashCode()
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
-
-
-