Package com.applitools.eyes
Class RectangleSize
- java.lang.Object
-
- com.applitools.eyes.RectangleSize
-
public class RectangleSize extends Object
Represents a 2D size.
-
-
Field Summary
Fields Modifier and Type Field Description static RectangleSizeEMPTY
-
Constructor Summary
Constructors Constructor Description RectangleSize(int width, int height)Creates a new RectangleSize instance.RectangleSize(RectangleSize source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetHeight()intgetWidth()inthashCode()booleanisEmpty()static RectangleSizeparse(String size)Parses a string into a {link RectangleSize} instance.RectangleSizescale(double scaleRatio)Get a scaled version of the current size.StringtoString()
-
-
-
Field Detail
-
EMPTY
public static RectangleSize EMPTY
-
-
Constructor Detail
-
RectangleSize
public RectangleSize(int width, int height)Creates a new RectangleSize instance.- Parameters:
width- The width of the rectangle.height- The height of the rectangle.
-
RectangleSize
public RectangleSize(RectangleSize source)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
getWidth
public int getWidth()
- Returns:
- The rectangle's width.
-
getHeight
public int getHeight()
- Returns:
- The rectangle's height.
-
parse
public static RectangleSize parse(String size)
Parses a string into a {link RectangleSize} instance.- Parameters:
size- A string representing width and height separated by "x".- Returns:
- An instance representing the input size.
-
scale
public RectangleSize scale(double scaleRatio)
Get a scaled version of the current size.- Parameters:
scaleRatio- The ratio by which to scale.- Returns:
- A scaled version of the current size.
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classObject- Parameters:
obj- ARectangleSizeinstance to be checked for equality with the current instance.- Returns:
trueif and only if the input objects are equal by value,falseotherwise.
-
-