Class PDNumberFormatDictionary
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.interactive.measurement.PDNumberFormatDictionary
-
- All Implemented Interfaces:
COSObjectable
public class PDNumberFormatDictionary extends java.lang.Object implements COSObjectable
This class represents a number format dictionary.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FRACTIONAL_DISPLAY_DECIMAL
Constant for showing a fractional value as decimal to the precision specified by the D entry.static java.lang.String
FRACTIONAL_DISPLAY_FRACTION
Constant for showing a fractional value as a fraction with denominator specified by the D entry.static java.lang.String
FRACTIONAL_DISPLAY_ROUND
Constant for showing a fractional value without fractional part; round to the nearest whole unit.static java.lang.String
FRACTIONAL_DISPLAY_TRUNCATE
Constant for showing a fractional value without fractional part; truncate to achieve whole units.static java.lang.String
LABEL_PREFIX_TO_VALUE
Constant indicating that the label specified by U is a postfix to the value.static java.lang.String
LABEL_SUFFIX_TO_VALUE
Constant indicating that the label specified by U is a suffix to the value.private COSDictionary
numberFormatDictionary
static java.lang.String
TYPE
The type of the dictionary.
-
Constructor Summary
Constructors Constructor Description PDNumberFormatDictionary()
Constructor.PDNumberFormatDictionary(COSDictionary dictionary)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getConversionFactor()
This will return the conversion factor.COSDictionary
getCOSObject()
This will return the dictionary.java.lang.String
getDecimalSeparator()
This will return the text to be used as the decimal point in displaying numerical values.int
getDenominator()
This will return the precision or denominator of a fractional amount.java.lang.String
getFractionalDisplay()
This will return the value for the manner to display a fractional value.java.lang.String
getLabelPositionToValue()
This will return a value indicating the ordering of the label specified by U to the calculated unit value.java.lang.String
getLabelPrefixString()
This will return the text to be concatenated to the left of the label specified by U.java.lang.String
getLabelSuffixString()
This will return the text to be concatenated after the label specified by U.java.lang.String
getThousandsSeparator()
This will return the text to be used between orders of thousands in display of numerical values.java.lang.String
getType()
This will return the type of the number format dictionary.java.lang.String
getUnits()
This will return the label for the units.boolean
isFD()
This will return the value indication if the denominator of the fractional value is reduced/truncated .void
setConversionFactor(float conversionFactor)
This will set the conversion factor.void
setDecimalSeparator(java.lang.String decimalSeparator)
This will set the text to be used as the decimal point in displaying numerical values.void
setDenominator(int denominator)
This will set the precision or denominator of a fractional amount.void
setFD(boolean fd)
This will set the value indication if the denominator of the fractional value is reduced/truncated .void
setFractionalDisplay(java.lang.String fractionalDisplay)
This will set the value for the manner to display a fractional value.void
setLabelPositionToValue(java.lang.String labelPositionToValue)
This will set the value indicating the ordering of the label specified by U to the calculated unit value.void
setLabelPrefixString(java.lang.String labelPrefixString)
This will set the text to be concatenated to the left of the label specified by U.void
setLabelSuffixString(java.lang.String labelSuffixString)
This will set the text to be concatenated after the label specified by U.void
setThousandsSeparator(java.lang.String thousandsSeparator)
This will set the text to be used between orders of thousands in display of numerical values.void
setUnits(java.lang.String units)
This will set the label for the units.
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
The type of the dictionary.- See Also:
- Constant Field Values
-
LABEL_SUFFIX_TO_VALUE
public static final java.lang.String LABEL_SUFFIX_TO_VALUE
Constant indicating that the label specified by U is a suffix to the value.- See Also:
- Constant Field Values
-
LABEL_PREFIX_TO_VALUE
public static final java.lang.String LABEL_PREFIX_TO_VALUE
Constant indicating that the label specified by U is a postfix to the value.- See Also:
- Constant Field Values
-
FRACTIONAL_DISPLAY_DECIMAL
public static final java.lang.String FRACTIONAL_DISPLAY_DECIMAL
Constant for showing a fractional value as decimal to the precision specified by the D entry.- See Also:
- Constant Field Values
-
FRACTIONAL_DISPLAY_FRACTION
public static final java.lang.String FRACTIONAL_DISPLAY_FRACTION
Constant for showing a fractional value as a fraction with denominator specified by the D entry.- See Also:
- Constant Field Values
-
FRACTIONAL_DISPLAY_ROUND
public static final java.lang.String FRACTIONAL_DISPLAY_ROUND
Constant for showing a fractional value without fractional part; round to the nearest whole unit.- See Also:
- Constant Field Values
-
FRACTIONAL_DISPLAY_TRUNCATE
public static final java.lang.String FRACTIONAL_DISPLAY_TRUNCATE
Constant for showing a fractional value without fractional part; truncate to achieve whole units.- See Also:
- Constant Field Values
-
numberFormatDictionary
private COSDictionary numberFormatDictionary
-
-
Constructor Detail
-
PDNumberFormatDictionary
public PDNumberFormatDictionary()
Constructor.
-
PDNumberFormatDictionary
public PDNumberFormatDictionary(COSDictionary dictionary)
Constructor.- Parameters:
dictionary
- the corresponding dictionary
-
-
Method Detail
-
getCOSObject
public COSDictionary getCOSObject()
This will return the dictionary.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- the number format dictionary
-
getType
public java.lang.String getType()
This will return the type of the number format dictionary. It must be "NumberFormat"- Returns:
- the type
-
getUnits
public java.lang.String getUnits()
This will return the label for the units.- Returns:
- the label for the units
-
setUnits
public void setUnits(java.lang.String units)
This will set the label for the units.- Parameters:
units
- the label for the units
-
getConversionFactor
public float getConversionFactor()
This will return the conversion factor.- Returns:
- the conversion factor
-
setConversionFactor
public void setConversionFactor(float conversionFactor)
This will set the conversion factor.- Parameters:
conversionFactor
- the conversion factor
-
getFractionalDisplay
public java.lang.String getFractionalDisplay()
This will return the value for the manner to display a fractional value.- Returns:
- the manner to display a fractional value
-
setFractionalDisplay
public void setFractionalDisplay(java.lang.String fractionalDisplay)
This will set the value for the manner to display a fractional value. Allowed values are "D", "F", "R" and "T"- Parameters:
fractionalDisplay
- the manner to display a fractional value
-
getDenominator
public int getDenominator()
This will return the precision or denominator of a fractional amount.- Returns:
- the precision or denominator
-
setDenominator
public void setDenominator(int denominator)
This will set the precision or denominator of a fractional amount.- Parameters:
denominator
- the precision or denominator
-
isFD
public boolean isFD()
This will return the value indication if the denominator of the fractional value is reduced/truncated .- Returns:
- fd
-
setFD
public void setFD(boolean fd)
This will set the value indication if the denominator of the fractional value is reduced/truncated . The denominator may not be reduced/truncated if true- Parameters:
fd
- fd
-
getThousandsSeparator
public java.lang.String getThousandsSeparator()
This will return the text to be used between orders of thousands in display of numerical values.- Returns:
- thousands separator
-
setThousandsSeparator
public void setThousandsSeparator(java.lang.String thousandsSeparator)
This will set the text to be used between orders of thousands in display of numerical values.- Parameters:
thousandsSeparator
- thousands separator
-
getDecimalSeparator
public java.lang.String getDecimalSeparator()
This will return the text to be used as the decimal point in displaying numerical values.- Returns:
- decimal separator
-
setDecimalSeparator
public void setDecimalSeparator(java.lang.String decimalSeparator)
This will set the text to be used as the decimal point in displaying numerical values.- Parameters:
decimalSeparator
- decimal separator
-
getLabelPrefixString
public java.lang.String getLabelPrefixString()
This will return the text to be concatenated to the left of the label specified by U.- Returns:
- label prefix
-
setLabelPrefixString
public void setLabelPrefixString(java.lang.String labelPrefixString)
This will set the text to be concatenated to the left of the label specified by U.- Parameters:
labelPrefixString
- label prefix
-
getLabelSuffixString
public java.lang.String getLabelSuffixString()
This will return the text to be concatenated after the label specified by U.- Returns:
- label suffix
-
setLabelSuffixString
public void setLabelSuffixString(java.lang.String labelSuffixString)
This will set the text to be concatenated after the label specified by U.- Parameters:
labelSuffixString
- label suffix
-
getLabelPositionToValue
public java.lang.String getLabelPositionToValue()
This will return a value indicating the ordering of the label specified by U to the calculated unit value.- Returns:
- label position
-
setLabelPositionToValue
public void setLabelPositionToValue(java.lang.String labelPositionToValue)
This will set the value indicating the ordering of the label specified by U to the calculated unit value. Possible values are "S" and "P"- Parameters:
labelPositionToValue
- label position
-
-