Size

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct

All Implemented Interfaces: com.aspose.ms.System.IEquatable, java.lang.Cloneable

public class Size extends Struct<Size> implements System.IEquatable<Size>, Cloneable

Stores an ordered pair of integers, typically the width and height of a rectangle.

Constructors

ConstructorDescription
Size()
Size(Point pt)Initializes a new instance of the Size struct from the specified Point.
Size(int width, int height)Initializes a new instance of the Size struct from the specified dimensions.

Methods

MethodDescription
to_SizeF(Size p)Converts the specified Size to a SizeF.
op_Addition(Size sz1, Size sz2)Adds the width and height of one Size structure to the width and height of another Size structure.
op_Subtraction(Size sz1, Size sz2)Subtracts the width and height of one Size structure from the width and height of another Size structure.
op_Multiply(int left, Size right)Multiplies a Size by an int producing Size.
op_Multiply(Size left, int right)Multiplies Size by an int producing Size.
op_Division(Size left, int right)Divides Size by an int producing Size.
op_Multiply(float left, Size right)Multiplies Size by a float producing SizeF.
op_Multiply(Size left, float right)Multiplies Size by a float producing SizeF.
op_Division(Size left, float right)Divides Size by a float producing SizeF.
op_Equality(Size sz1, Size sz2)Tests whether two Size structures are equal.
op_Inequality(Size sz1, Size sz2)Tests whether two Size structures are different.
to_Point(Size size)Converts the specified Size to a Point.
add(Size sz1, Size sz2)Adds the width and height of one Size structure to the width and height of another Size structure.
ceiling(SizeF value)Converts the specified SizeF structure to a Size structure by rounding the values of the Size structure to the next higher integer values.
subtract(Size sz1, Size sz2)Subtracts the width and height of one Size structure from the width and height of another Size structure.
truncate(SizeF value)Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lower integer values.
round(SizeF value)Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values.
isEquals(Size obj1, Size obj2)
getEmpty()
isEmpty()Gets a value indicating whether this Size has width and height of 0.
getWidth()Gets the horizontal component of this Size.
setWidth(int value)Sets the horizontal component of this Size.
getHeight()Gets the vertical component of this Size.
setHeight(int value)Sets the vertical component of this Size.
equals(Object obj)Tests to see whether the specified object is a Size with the same dimensions as this Size.
hashCode()Returns a hash code for this Size structure.
toString()
equals(Size other)Tests whether other Size structure has the same size of this Size structure.
CloneTo(Size that)
Clone()
clone()

Size()

public Size()

Size(Point pt)

public Size(Point pt)

Initializes a new instance of the Size struct from the specified Point.

Parameters:

ParameterTypeDescription
ptPointThe Point from which to initialize this Size.

Size(int width, int height)

public Size(int width, int height)

Initializes a new instance of the Size struct from the specified dimensions.

Parameters:

ParameterTypeDescription
widthintThe width component of the new Size.
heightintThe height component of the new Size.

to_SizeF(Size p)

public static SizeF to_SizeF(Size p)

Converts the specified Size to a SizeF.

Parameters:

ParameterTypeDescription
pSizeThe Size to convert.

Returns: SizeF - The SizeF structure to which this operator converts.

op_Addition(Size sz1, Size sz2)

public static Size op_Addition(Size sz1, Size sz2)

Adds the width and height of one Size structure to the width and height of another Size structure.

Parameters:

ParameterTypeDescription
sz1SizeThe first Size to add.
sz2SizeThe second Size to add.

Returns: Size - A Size structure that is the result of the addition operation.

op_Subtraction(Size sz1, Size sz2)

public static Size op_Subtraction(Size sz1, Size sz2)

Subtracts the width and height of one Size structure from the width and height of another Size structure.

Parameters:

ParameterTypeDescription
sz1SizeThe Size structure on the left side of the subtraction operator.
sz2SizeThe Size structure on the right side of the subtraction operator.

Returns: Size - A Size structure that is the result of the subtraction operation.

op_Multiply(int left, Size right)

public static Size op_Multiply(int left, Size right)

Multiplies a Size by an int producing Size.

Parameters:

ParameterTypeDescription
leftintMultiplier of type int.
rightSizeMultiplicand of type Size.

Returns: Size - Product of type Size.

op_Multiply(Size left, int right)

public static Size op_Multiply(Size left, int right)

Multiplies Size by an int producing Size.

Parameters:

ParameterTypeDescription
leftSizeMultiplicand of type Size.
rightintMultiplier of type int.

Returns: Size - Product of type Size.

op_Division(Size left, int right)

public static Size op_Division(Size left, int right)

Divides Size by an int producing Size.

Parameters:

ParameterTypeDescription
leftSizeDividend of type Size.
rightintDivisor of type int.

Returns: Size - Result of type Size.

op_Multiply(float left, Size right)

public static SizeF op_Multiply(float left, Size right)

Multiplies Size by a float producing SizeF.

Parameters:

ParameterTypeDescription
leftfloatMultiplier of type float.
rightSizeMultiplicand of type Size.

Returns: SizeF - Product of type SizeF.

op_Multiply(Size left, float right)

public static SizeF op_Multiply(Size left, float right)

Multiplies Size by a float producing SizeF.

Parameters:

ParameterTypeDescription
leftSizeMultiplicand of type Size.
rightfloatMultiplier of type float.

Returns: SizeF - Product of type SizeF.

op_Division(Size left, float right)

public static SizeF op_Division(Size left, float right)

Divides Size by a float producing SizeF.

Parameters:

ParameterTypeDescription
leftSizeDividend of type Size.
rightfloatDivisor of type int.

Returns: SizeF - Result of type SizeF.

op_Equality(Size sz1, Size sz2)

public static boolean op_Equality(Size sz1, Size sz2)

Tests whether two Size structures are equal.

Parameters:

ParameterTypeDescription
sz1SizeThe Size structure on the left side of the equality operator.
sz2SizeThe Size structure on the right of the equality operator.

Returns: boolean - true if sz1 and sz2 have equal width and height; otherwise, false.

op_Inequality(Size sz1, Size sz2)

public static boolean op_Inequality(Size sz1, Size sz2)

Tests whether two Size structures are different.

Parameters:

ParameterTypeDescription
sz1SizeThe Size structure on the left of the inequality operator.
sz2SizeThe Size structure on the right of the inequality operator.

Returns: boolean - true if sz1 and sz2 differ either in width or height; false if sz1 and sz2 are equal.

to_Point(Size size)

public static Point to_Point(Size size)

Converts the specified Size to a Point.

Parameters:

ParameterTypeDescription
sizeSizeThe Size to convert.

Returns: Point - The Point structure to which this operator converts.

add(Size sz1, Size sz2)

public static Size add(Size sz1, Size sz2)

Adds the width and height of one Size structure to the width and height of another Size structure.

Parameters:

ParameterTypeDescription
sz1SizeThe first Size to add.
sz2SizeThe second Size to add.

Returns: Size - A Size structure that is the result of the addition operation.

ceiling(SizeF value)

public static Size ceiling(SizeF value)

Converts the specified SizeF structure to a Size structure by rounding the values of the Size structure to the next higher integer values.

Parameters:

ParameterTypeDescription
valueSizeFThe SizeF structure to convert.

Returns: Size - The Size structure this method converts to.

subtract(Size sz1, Size sz2)

public static Size subtract(Size sz1, Size sz2)

Subtracts the width and height of one Size structure from the width and height of another Size structure.

Parameters:

ParameterTypeDescription
sz1SizeThe Size structure on the left side of the subtraction operator.
sz2SizeThe Size structure on the right side of the subtraction operator.

Returns: Size - The Size that is a result of the subtraction operation.

truncate(SizeF value)

public static Size truncate(SizeF value)

Converts the specified SizeF structure to a Size structure by truncating the values of the SizeF structure to the next lower integer values.

Parameters:

ParameterTypeDescription
valueSizeFThe SizeF structure to convert.

Returns: Size - The Size structure this method converts to.

round(SizeF value)

public static Size round(SizeF value)

Converts the specified SizeF structure to a Size structure by rounding the values of the SizeF structure to the nearest integer values.

Parameters:

ParameterTypeDescription
valueSizeFThe SizeF structure to convert.

Returns: Size - The Size structure this method converts to.

isEquals(Size obj1, Size obj2)

public static boolean isEquals(Size obj1, Size obj2)

Parameters:

ParameterTypeDescription
obj1Size
obj2Size

Returns: boolean

getEmpty()

public static Size getEmpty()

Returns: Size

isEmpty()

public final boolean isEmpty()

Gets a value indicating whether this Size has width and height of 0.

Returns: boolean - a value indicating whether this Size has width and height of 0.

getWidth()

public final int getWidth()

Gets the horizontal component of this Size.

Returns: int - the horizontal component of this Size.

setWidth(int value)

public final void setWidth(int value)

Sets the horizontal component of this Size.

Parameters:

ParameterTypeDescription
valueintthe horizontal component of this Size.

getHeight()

public final int getHeight()

Gets the vertical component of this Size.

Returns: int - the vertical component of this Size.

setHeight(int value)

public final void setHeight(int value)

Sets the vertical component of this Size.

Parameters:

ParameterTypeDescription
valueintthe vertical component of this Size.

equals(Object obj)

public boolean equals(Object obj)

Tests to see whether the specified object is a Size with the same dimensions as this Size.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe Object to test.

Returns: boolean - true if obj is a Size and has the same width and height as this Size; otherwise, false.

hashCode()

public int hashCode()

Returns a hash code for this Size structure.

Returns: int - An integer value that specifies a hash value for this Size structure.

toString()

public String toString()

Returns: java.lang.String

equals(Size other)

public final boolean equals(Size other)

Tests whether other Size structure has the same size of this Size structure.

Parameters:

ParameterTypeDescription
otherSizeOther size to test

Returns: boolean - This method returns true if other Size structure and its Width and Height properties are equal to the corresponding properties of this Size structure; otherwise, false.

CloneTo(Size that)

public void CloneTo(Size that)

Parameters:

ParameterTypeDescription
thatSize

Clone()

public Size Clone()

Returns: Size

clone()

public Size clone()

Returns: Size