org.apache.fop.fo.properties

Class FixedLength

Implemented Interfaces:
Length, Numeric

public final class FixedLength
extends LengthProperty

An absolute length quantity in XSL

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.fop.fo.properties.LengthProperty

LengthProperty.Maker

Field Summary

static String
CM
Describes the unit centimeter.
static String
INCH
Describes the unit inch.
static String
MM
Describes the unit millimeter.
static String
MPT
Describes the unit millipoint.
static String
PICA
Describes the unit pica.
static String
POINT
Describes the unit point.
static FixedLength
ZERO_FIXED_LENGTH
canonical zero-length instance

Fields inherited from class org.apache.fop.fo.properties.Property

log

Method Summary

boolean
equals(Object obj)
static FixedLength
getInstance(double numUnits)
Return the cached FixedLength instance corresponding to the computed value.
static FixedLength
getInstance(double numUnits, String units)
Return the cached FixedLength instance corresponding to the computed value This method assumes a source-resolution of 1 (1px = 1pt)
static FixedLength
getInstance(double numUnits, String units, float sourceResolution)
Return the cached FixedLength instance corresponding to the computed value in base-units (millipoints).
double
getNumericValue()
double
getNumericValue(PercentBaseContext context)
int
getValue()
int
getValue(PercentBaseContext context)
int
hashCode()
boolean
isAbsolute()
Return true since a FixedLength is always absolute.
String
toString()

Methods inherited from class org.apache.fop.fo.properties.LengthProperty

getDimension, getLength, getNumeric, getObject, getTableUnits

Methods inherited from class org.apache.fop.fo.properties.Property

getCharacter, getColor, getCondLength, getEnum, getKeep, getLength, getLengthPair, getLengthRange, getList, getNCname, getNumber, getNumeric, getObject, getSpace, getSpecifiedValue, getString, isAuto, setSpecifiedValue, toString

Field Details

CM

public static final String CM
Describes the unit centimeter.

INCH

public static final String INCH
Describes the unit inch.

MM

public static final String MM
Describes the unit millimeter.

MPT

public static final String MPT
Describes the unit millipoint.

PICA

public static final String PICA
Describes the unit pica.

POINT

public static final String POINT
Describes the unit point.

ZERO_FIXED_LENGTH

public static final FixedLength ZERO_FIXED_LENGTH
canonical zero-length instance

Method Details

equals

public boolean equals(Object obj)

getInstance

public static FixedLength getInstance(double numUnits)
Return the cached FixedLength instance corresponding to the computed value. This method assumes 'millipoints' (non-standard) as units, and an implied source-resolution of 1 (1px = 1pt).
Parameters:
numUnits - input units
Returns:
the canonical FixedLength instance corresponding to the given number of units and unit specifier

getInstance

public static FixedLength getInstance(double numUnits,
                                      String units)
Return the cached FixedLength instance corresponding to the computed value This method assumes a source-resolution of 1 (1px = 1pt)
Parameters:
numUnits - input units
units - unit specifier
Returns:
the canonical FixedLength instance corresponding to the given number of units and unit specifier

getInstance

public static FixedLength getInstance(double numUnits,
                                      String units,
                                      float sourceResolution)
Return the cached FixedLength instance corresponding to the computed value in base-units (millipoints).
Parameters:
numUnits - quantity of input units
units - input unit specifier
sourceResolution - input/source resolution (= ratio of pixels per pt)
Returns:
the canonical FixedLength instance corresponding to the given number of units and unit specifier in the given resolution

getNumericValue

public double getNumericValue()
Specified by:
getNumericValue in interface Numeric

getNumericValue

public double getNumericValue(PercentBaseContext context)
Specified by:
getNumericValue in interface Numeric

getValue

public int getValue()
Specified by:
getValue in interface Length
getValue in interface Numeric

getValue

public int getValue(PercentBaseContext context)
Specified by:
getValue in interface Length
getValue in interface Numeric

hashCode

public int hashCode()

isAbsolute

public boolean isAbsolute()
Return true since a FixedLength is always absolute.
Specified by:
isAbsolute in interface Numeric

toString

public String toString()
Overrides:
toString in interface Property

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.