public class Unit
extends java.lang.Object
| Constructor and Description |
|---|
Unit()
the default constructor
|
Unit(double value)
Initializes a new instance of the Unit structure with the specified double precision floating point number.
|
Unit(double value,
int type)
Initializes a new instance of the Unit structure with the specified double precision floating point number and UnitType.
|
Unit(int value)
Initializes a new instance of the Unit structure with the specified 32-bit signed integer.
|
Unit(java.lang.String value)
Initializes a new instance of the Unit structure with the specified length.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getExtension(int type)
get string by the type,may get "px" "pt" "%" and so one;
|
int |
getType()
Gets the unit type of the Unit.
|
double |
getValue()
Gets the length of the Unit.
|
boolean |
isEmpty()
Gets a value indicating whether the Unit is empty.
|
static Unit |
parse(java.lang.String s)
Converts the specified string to a Unit.
|
static Unit |
percentage(double n)
Creates a Unit of type Percentage from the specified double-precision floating-point number.
|
static Unit |
pixel(int n)
Creates a Unit of type Pixel from the specified 32-bit signed integer.
|
static Unit |
point(int n)
Creates a Unit of type Point from the specified 32-bit signed integer.
|
java.lang.String |
toString()
get string representation of the unit.
|
public Unit()
public Unit(double value,
int type)
public Unit(double value)
public Unit(int value)
public Unit(java.lang.String value)
public boolean isEmpty()
public int getType()
public double getValue()
public static Unit parse(java.lang.String s)
public static Unit percentage(double n)
public static Unit pixel(int n)
public static Unit point(int n)
public static java.lang.String getExtension(int type)
public java.lang.String toString()
toString in class java.lang.ObjectSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.