HERE Android SDK Developer's Guide

ViewRect

The class ViewRect is a member of com.here.android.mpa.common .

Class Summary

public final class ViewRect

extends java.lang.Object

Represents a rectangle defined by the top-left corner's coordinate and the width and height of the rectangle.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in ViewRect
Constructors

ViewRect (int x, int y, int width, int height)

Constructor that initializes specified X and Y coordinates of the top-left corner plus width and height values, in pixels, for the new ViewRect object.

Method Summary

Table 2. Methods in ViewRect
Methods

public boolean equals (Object other)

Determines whether the specified Object is equal to this ViewRect object.

public int getHeight ()

Gets the current height, in pixels, of the ViewRect .

public int getWidth ()

Gets the current width, in pixels, of the ViewRect .

public int getX ()

Gets the current X-coordinate of the ViewRect .

public int getY ()

Gets the current Y-coordinate of the ViewRect .

public int hashCode ()

Calculates and returns a hash code value for the ViewRect .

public boolean isValid ()

Determines whether the ViewRect object is valid.

public void setHeight (int height)

Sets a height, in pixels, for the ViewRect .

public void setWidth (int width)

Sets a width, in pixels, for the ViewRect .

public void setX (int x)

Sets an X-coordinate for the ViewRect .

public void setY (int y)

Sets a Y-coordinate for the ViewRect .

Class Details

Represents a rectangle defined by the top-left corner's coordinate and the width and height of the rectangle.

Constructor Details

ViewRect (int x, int y, int width, int height)

Constructor that initializes specified X and Y coordinates of the top-left corner plus width and height values, in pixels, for the new ViewRect object.

Parameters:

  • x

    An initial X-coordinate for the left side of the rectangle

  • y

    An initial Y-coordinate for the top of the rectangle

  • width

    An initial width for the rectangle

  • height

    An initial height for the rectangle

Method Details

public boolean equals (Object other)

Determines whether the specified Object is equal to this ViewRect object.

Parameters:

  • other

    An Object to compare with this ViewRect object for equality

Returns:

True if the compared objects are equal, false otherwise

public int getHeight ()

Gets the current height, in pixels, of the ViewRect .

Returns:

The current height

public int getWidth ()

Gets the current width, in pixels, of the ViewRect .

Returns:

The current width

public int getX ()

Gets the current X-coordinate of the ViewRect .

Returns:

The current X-coordinate

public int getY ()

Gets the current Y-coordinate of the ViewRect .

Returns:

The current Y-coordinate

public int hashCode ()

Calculates and returns a hash code value for the ViewRect .

Returns:

The hash code

public boolean isValid ()

Determines whether the ViewRect object is valid.

Returns:

True if the ViewRect is valid, false otherwise

public void setHeight (int height)

Sets a height, in pixels, for the ViewRect .

Parameters:

  • height

    Desired height

public void setWidth (int width)

Sets a width, in pixels, for the ViewRect .

Parameters:

  • width

    Desired width

public void setX (int x)

Sets an X-coordinate for the ViewRect .

Parameters:

  • x

    Desired X-coordinate

public void setY (int y)

Sets a Y-coordinate for the ViewRect .

Parameters:

  • y

    Desired Y-coordinate