public class UnitValue extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PERCENT |
static int |
POINT |
protected int |
unitType |
protected float |
value |
Constructor and Description |
---|
UnitValue(int unitType, float value)
Creates a UnitValue object with a specified type and value.
|
UnitValue(UnitValue unitValue)
Creates a copy of UnitValue object.
|
Modifier and Type | Method and Description |
---|---|
static UnitValue[] |
createPercentArray(float[] values)
Creates an array of UnitValue PERCENT objects with specified values.
|
static UnitValue[] |
createPercentArray(int size)
Creates an array of UnitValue PERCENT objects with equal values.
|
static UnitValue |
createPercentValue(float value)
Creates a UnitValue PERCENT object with a specified value.
|
static UnitValue[] |
createPointArray(float[] values)
Creates an array of UnitValue POINT objects with specified values.
|
static UnitValue |
createPointValue(float value)
Creates a UnitValue POINT object with a specified value.
|
boolean |
equals(Object obj) |
int |
getUnitType()
Returns the unit this value is stored in, either points (pt) or percent(%)
|
float |
getValue()
Gets the measured value stored in this object
|
int |
hashCode() |
boolean |
isPercentValue()
Returns whether or not the value is stored in percent (%)
|
boolean |
isPointValue()
Returns whether or not the value is stored in points (pt)
|
void |
setUnitType(int unitType)
Sets the unit this value is stored in, either points (pt) or percent(%)
|
void |
setValue(float value)
Sets the measured value stored in this object
|
String |
toString() |
public static final int POINT
public static final int PERCENT
protected int unitType
protected float value
public UnitValue(int unitType, float value)
public UnitValue(UnitValue unitValue)
unitValue
- the value to be stored
public static UnitValue createPointValue(float value)
public static UnitValue createPercentValue(float value)
public static UnitValue[] createPercentArray(float[] values)
public static UnitValue[] createPercentArray(int size)
public static UnitValue[] createPointArray(float[] values)
public int getUnitType()
public void setUnitType(int unitType)
public float getValue()
float
public void setValue(float value)
value
- a float
public boolean isPointValue()
true
if stored in points
public boolean isPercentValue()
true
if stored in percent
Copyright © 1998–2020 iText Group NV. All rights reserved.