Class PDNumberFormatDictionary
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.measurement.PDNumberFormatDictionary
-
- All Implemented Interfaces:
COSObjectable
public class PDNumberFormatDictionary extends Object implements COSObjectable
This class represents a number format dictionary.
-
-
Field Summary
Fields Modifier and Type Field Description static StringFRACTIONAL_DISPLAY_DECIMALConstant for showing a fractional value as decimal to the precision specified by the D entry.static StringFRACTIONAL_DISPLAY_FRACTIONConstant for showing a fractional value as a fraction with denominator specified by the D entry.static StringFRACTIONAL_DISPLAY_ROUNDConstant for showing a fractional value without fractional part; round to the nearest whole unit.static StringFRACTIONAL_DISPLAY_TRUNCATEConstant for showing a fractional value without fractional part; truncate to achieve whole units.static StringLABEL_PREFIX_TO_VALUEConstant indicating that the label specified by U is a postfix to the value.static StringLABEL_SUFFIX_TO_VALUEConstant indicating that the label specified by U is a suffix to the value.static StringTYPEThe 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 floatgetConversionFactor()This will return the conversion factor.COSDictionarygetCOSObject()This will return the dictionary.StringgetDecimalSeparator()This will return the text to be used as the decimal point in displaying numerical values.intgetDenominator()This will return the precision or denominator of a fractional amount.StringgetFractionalDisplay()This will return the value for the manner to display a fractional value.StringgetLabelPositionToValue()This will return a value indicating the ordering of the label specified by U to the calculated unit value.StringgetLabelPrefixString()This will return the text to be concatenated to the left of the label specified by U.StringgetLabelSuffixString()This will return the text to be concatenated after the label specified by U.StringgetThousandsSeparator()This will return the text to be used between orders of thousands in display of numerical values.StringgetType()This will return the type of the number format dictionary.StringgetUnits()This will return the label for the units.booleanisFD()This will return the value indication if the denominator of the fractional value is reduced/truncated .voidsetConversionFactor(float conversionFactor)This will set the conversion factor.voidsetDecimalSeparator(String decimalSeparator)This will set the text to be used as the decimal point in displaying numerical values.voidsetDenominator(int denominator)This will set the precision or denominator of a fractional amount.voidsetFD(boolean fd)This will set the value indication if the denominator of the fractional value is reduced/truncated .voidsetFractionalDisplay(String fractionalDisplay)This will set the value for the manner to display a fractional value.voidsetLabelPositionToValue(String labelPositionToValue)This will set the value indicating the ordering of the label specified by U to the calculated unit value.voidsetLabelPrefixString(String labelPrefixString)This will set the text to be concatenated to the left of the label specified by U.voidsetLabelSuffixString(String labelSuffixString)This will set the text to be concatenated after the label specified by U.voidsetThousandsSeparator(String thousandsSeparator)This will set the text to be used between orders of thousands in display of numerical values.voidsetUnits(String units)This will set the label for the units.
-
-
-
Field Detail
-
TYPE
public static final String TYPE
The type of the dictionary.- See Also:
- Constant Field Values
-
LABEL_SUFFIX_TO_VALUE
public static final 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 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 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 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 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 String FRACTIONAL_DISPLAY_TRUNCATE
Constant for showing a fractional value without fractional part; truncate to achieve whole units.- See Also:
- Constant Field Values
-
-
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:
getCOSObjectin interfaceCOSObjectable- Returns:
- the number format dictionary
-
getType
public String getType()
This will return the type of the number format dictionary. It must be "NumberFormat"- Returns:
- the type
-
getUnits
public String getUnits()
This will return the label for the units.- Returns:
- the label for the units
-
setUnits
public void setUnits(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 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(String fractionalDisplay)
This will set the value for the manner to display a fractional value. Allowed values are "D", "F", "R", "T" and null.- 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 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(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 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(String decimalSeparator)
This will set the text to be used as the decimal point in displaying numerical values.- Parameters:
decimalSeparator- decimal separator
-
getLabelPrefixString
public 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(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 String getLabelSuffixString()
This will return the text to be concatenated after the label specified by U.- Returns:
- label suffix
-
setLabelSuffixString
public void setLabelSuffixString(String labelSuffixString)
This will set the text to be concatenated after the label specified by U.- Parameters:
labelSuffixString- label suffix
-
getLabelPositionToValue
public 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(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", "P" and null.- Parameters:
labelPositionToValue- label position
-
-