public final class PaperLength extends Object implements Serializable
| Constructor and Description |
|---|
PaperLength(double value,
PaperUnit unit)
Create a paper length given a scalar value and a unit of measure.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Equals implementation.
|
PaperUnit |
getUnit()
Returns the unit of measure for this length.
|
double |
getValue()
Returns the value of the measure.
|
double |
getValue(PaperUnit unit,
Integer dotsPerInch)
Return the length in the requested unit, converting if necessary.
|
int |
hashCode()
Hashcode implementation.
|
String |
toString() |
public PaperLength(double value,
PaperUnit unit)
new PaperLength(PaperUnit.INCH, 1.0);value - The value of measure for this length.unit - The unit of measure for this length.IllegalArgumentException - if the specified unit is null.public PaperUnit getUnit()
public double getValue()
public double getValue(PaperUnit unit, Integer dotsPerInch)
unit - the desired unit.IllegalArgumentException - if the specified unit is null.public boolean equals(Object o)
public int hashCode()