Class UnitValue
- Namespace
- iText.Layout.Properties
- Assembly
- itext.layout.dll
A specialized class that holds a value and the unit it is measured in.
public class UnitValue
- Inheritance
-
UnitValue
- Inherited Members
Constructors
UnitValue(int, float)
Creates a UnitValue object with a specified type and value.
public UnitValue(int unitType, float value)
Parameters
UnitValue(UnitValue)
Creates a copy of UnitValue object.
public UnitValue(UnitValue unitValue)
Parameters
unitValue
UnitValuethe value to be stored
Fields
PERCENT
public const int PERCENT = 2
Field Value
POINT
public const int POINT = 1
Field Value
unitType
protected int unitType
Field Value
value
protected float value
Field Value
Methods
CreatePercentArray(int)
Creates an array of UnitValue PERCENT objects with equal values.
public static UnitValue[] CreatePercentArray(int size)
Parameters
size
intof the resulted array.
Returns
CreatePercentArray(float[])
Creates an array of UnitValue PERCENT objects with specified values.
public static UnitValue[] CreatePercentArray(float[] values)
Parameters
values
float[]the values to be stored.
Returns
CreatePercentValue(float)
Creates a UnitValue PERCENT object with a specified value.
public static UnitValue CreatePercentValue(float value)
Parameters
value
floatthe value to be stored.
Returns
CreatePointArray(float[])
Creates an array of UnitValue POINT objects with specified values.
public static UnitValue[] CreatePointArray(float[] values)
Parameters
values
float[]the values to be stored.
Returns
CreatePointValue(float)
Creates a UnitValue POINT object with a specified value.
public static UnitValue CreatePointValue(float value)
Parameters
value
floatthe value to be stored.
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetUnitType()
Returns the unit this value is stored in, either points (pt) or percent(%)
public virtual int GetUnitType()
Returns
GetValue()
Gets the measured value stored in this object
public virtual float GetValue()
Returns
- float
the value, as a
float
IsPercentValue()
Returns whether or not the value is stored in percent (%)
public virtual bool IsPercentValue()
Returns
- bool
true
if stored in percent
IsPointValue()
Returns whether or not the value is stored in points (pt)
public virtual bool IsPointValue()
Returns
- bool
true
if stored in points
SetUnitType(int)
Sets the unit this value is stored in, either points (pt) or percent(%)
public virtual void SetUnitType(int unitType)
Parameters
SetValue(float)
Sets the measured value stored in this object
public virtual void SetValue(float value)
Parameters
value
floata
float
ToString()
public override string ToString()