com.pcauto.util
Class QuantityFormat

java.lang.Object
  extended byjava.text.Format
      extended bycom.pcauto.util.QuantityFormat
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
CurrencyFormat, DensityFormat, DimensionFormat, DistanceFormat, ElapsedTimeFormat, TemperatureFormat, VolumeFormat, WeightFormat

public abstract class QuantityFormat
extends java.text.Format

QuantityFormat provides common function to be used by its subclasses

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
protected  boolean groupingUsed
           
protected  int scale
           
protected  Units units
           
 
Constructor Summary
QuantityFormat()
           
 
Method Summary
 int getScale()
          Returns int value of scale.
 boolean isGroupingUsed()
          Returns true if grouping is used in this format.
 void setGroupingUsed(boolean newValue)
          Set whether or not grouping will be used in this format.
 void setScale(int scale)
          Sets scale for use in format method.
 
Methods inherited from class java.text.Format
clone, format, format, formatToCharacterIterator, parseObject, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scale

protected int scale

groupingUsed

protected boolean groupingUsed

units

protected Units units
Constructor Detail

QuantityFormat

public QuantityFormat()
Method Detail

isGroupingUsed

public boolean isGroupingUsed()
Returns true if grouping is used in this format. For example, in the English locale, with grouping on, the number 1234567 might be formatted as "1,234,567". The grouping separator as well as the size of each group is locale dependant.

Returns:
boolean grouping value
See Also:
setGroupingUsed(boolean)

setGroupingUsed

public void setGroupingUsed(boolean newValue)
Set whether or not grouping will be used in this format.

See Also:
isGroupingUsed()

setScale

public void setScale(int scale)
Sets scale for use in format method.


getScale

public int getScale()
Returns int value of scale.

Returns:
int value current scale