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.
|
Modifier and Type | Method and Description |
---|---|
static UnitValue |
createPercentValue(float value)
Creates a UnitValue PERCENT object with a specified value.
|
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
|
public static final int POINT
public static final int PERCENT
protected int unitType
protected float value
public static UnitValue createPointValue(float value)
public static UnitValue createPercentValue(float value)
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–2016 iText Group NV. All rights reserved.