public class

Size

extends Object
implements Parcelable Comparable<T>
java.lang.Object
   ↳ com.pspdfkit.utils.Size

Class Overview

Data structure representing a size.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<Size> CREATOR
public final float height
public final float width
Public Constructors
Size(float width, float height)
Creates a size representation.
Protected Constructors
Size(Parcel in)
Public Methods
int compareTo(Size another)
int describeContents()
boolean equals(Object o)
int hashCode()
boolean isPortrait()
Check if size has portrait orientation.
Size toLandscape()
Create size in landscape orientation.
Size toPortrait()
Create size in portrait orientation.
RectF toRect(RectF reusableeRect)
Expresses this size as (0, 0, width, height) rect.
RectF toRect()
Expresses this size as (0, 0, width, height) rect.
String toString()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface java.lang.Comparable

Fields

public static final Creator<Size> CREATOR

public final float height

public final float width

Public Constructors

public Size (float width, float height)

Creates a size representation.

Parameters
width Size width value.
height Size height value.

Protected Constructors

protected Size (Parcel in)

Public Methods

public int compareTo (Size another)

public int describeContents ()

public boolean equals (Object o)

public int hashCode ()

public boolean isPortrait ()

Check if size has portrait orientation.

Returns
  • true if height >= width

public Size toLandscape ()

Create size in landscape orientation.

Returns
  • Copy of this size in landscape orientation (width > height).

public Size toPortrait ()

Create size in portrait orientation.

Returns
  • Copy of this size in portrait orientation (width <= height).

public RectF toRect (RectF reusableeRect)

Expresses this size as (0, 0, width, height) rect.

public RectF toRect ()

Expresses this size as (0, 0, width, height) rect.

public String toString ()

public void writeToParcel (Parcel dest, int flags)