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
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
pt | Point | The 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:
Parameter | Type | Description |
---|---|---|
width | int | The width component of the new Size. |
height | int | The 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:
Parameter | Type | Description |
---|---|---|
p | Size | The 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:
Parameter | Type | Description |
---|---|---|
sz1 | Size | The first Size to add. |
sz2 | Size | The 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:
Parameter | Type | Description |
---|---|---|
sz1 | Size | The Size structure on the left side of the subtraction operator. |
sz2 | Size | The 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:
Parameter | Type | Description |
---|---|---|
left | int | Multiplier of type int . |
right | Size | Multiplicand 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:
Parameter | Type | Description |
---|---|---|
left | Size | Multiplicand of type Size. |
right | int | Multiplier 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:
Parameter | Type | Description |
---|---|---|
left | Size | Dividend of type Size. |
right | int | Divisor 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:
Parameter | Type | Description |
---|---|---|
left | float | Multiplier of type float . |
right | Size | Multiplicand 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:
Parameter | Type | Description |
---|---|---|
left | Size | Multiplicand of type Size. |
right | float | Multiplier 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:
Parameter | Type | Description |
---|---|---|
left | Size | Dividend of type Size. |
right | float | Divisor 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:
Parameter | Type | Description |
---|---|---|
sz1 | Size | The Size structure on the left side of the equality operator. |
sz2 | Size | The 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:
Parameter | Type | Description |
---|---|---|
sz1 | Size | The Size structure on the left of the inequality operator. |
sz2 | Size | The 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:
Parameter | Type | Description |
---|---|---|
size | Size | The 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:
Parameter | Type | Description |
---|---|---|
sz1 | Size | The first Size to add. |
sz2 | Size | The 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:
Parameter | Type | Description |
---|---|---|
value | SizeF | The 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:
Parameter | Type | Description |
---|---|---|
sz1 | Size | The Size structure on the left side of the subtraction operator. |
sz2 | Size | The 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:
Parameter | Type | Description |
---|---|---|
value | SizeF | The 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:
Parameter | Type | Description |
---|---|---|
value | SizeF | The 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:
Parameter | Type | Description |
---|---|---|
obj1 | Size | |
obj2 | Size |
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:
Parameter | Type | Description |
---|---|---|
value | int | the 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:
Parameter | Type | Description |
---|---|---|
value | int | the 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:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The 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:
Parameter | Type | Description |
---|---|---|
other | Size | Other 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:
Parameter | Type | Description |
---|---|---|
that | Size |
Clone()
public Size Clone()
Returns: Size
clone()
public Size clone()
Returns: Size