All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class guinea.player.VolumeFormat

java.lang.Object
   |
   +----java.text.Format
           |
           +----guinea.player.VolumeFormat

public class VolumeFormat
extends Format
implements PropertyLoader
The VolumeFormat class is mainly used to print the volume level objects in desired numeric format and volume scale with the ResPrint tool. For formatting the numeric volume level, the java.text.DecimalFormat is used.

See Also:
DecimalFormat, Volume

Variable Index

· nFormat
The decimal formatting object used to format the numeric volume level.
· scale
The volume scale to use for printing the volume level.

Constructor Index

· VolumeFormat()
Construct a new volume formatter.
· VolumeFormat(int)
Construct a new volume formatter.
· VolumeFormat(int, String)
Construct a new volume formatter.
· VolumeFormat(String)
Construct a new volume formatter.

Method Index

· applyPattern(String)
Set the formatting pattern to use for formatting numeric value.
· format(Object, StringBuffer, FieldPosition)
Formats a Volume object to produce a string.
· getScale()
Get the scale we are printing in.
· parseObject(String, ParsePosition)
This class doesn't yet do parsing volume strings.
· propertyLoad(Properties, String)
Load information from properties to this item.
· setScale(int)
Set the scale we are printing in.

Variables

· nFormat
 protected DecimalFormat nFormat
The decimal formatting object used to format the numeric volume level.

· scale
 protected int scale
The volume scale to use for printing the volume level. The default is to use decibel scale.

See Also:
Volume, VOLUME_DECIBEL, VOLUME_LINEAR, VOLUME_PERCENT

Constructors

· VolumeFormat
 public VolumeFormat()
Construct a new volume formatter.

· VolumeFormat
 public VolumeFormat(int scale)
Construct a new volume formatter.

Parameters:
scale - The volume scale to use for printing.
See Also:
scale
· VolumeFormat
 public VolumeFormat(String pattern)
Construct a new volume formatter.

Parameters:
pattern - The pattern for formatting the numeric value.
See Also:
applyPattern, applyPattern
· VolumeFormat
 public VolumeFormat(int scale,
                     String pattern)
Construct a new volume formatter.

Parameters:
scale - The volume scale to use for printing.
pattern - The pattern for formatting the numeric value.
See Also:
applyPattern, applyPattern, scale

Methods

· format
 public StringBuffer format(Object obj,
                            StringBuffer toAppendTo,
                            FieldPosition pos)
Formats a Volume object to produce a string.

Parameters:
obj - The object to format, must be a Volume-object.
toAppendTo - where the text is to be appended
status - On input: an alignment field, if desired. On output: the offsets of the alignment field.
Returns:
the value passed in as toAppendTo.
Throws: IllegalArgumentException
when the Format cannot format the given object, such as the object is not a Volume object.
Overrides:
format in class Format
See Also:
Volume
· parseObject
 public Object parseObject(String source,
                           ParsePosition status)
This class doesn't yet do parsing volume strings.

Returns:
This method always returns null.
Overrides:
parseObject in class Format
· applyPattern
 public void applyPattern(String pattern)
Set the formatting pattern to use for formatting numeric value.

Parameters:
pattern - A DecimalFormat-pattern.
See Also:
applyPattern
· getScale
 public int getScale()
Get the scale we are printing in.

Returns:
The type of scale that is used.
See Also:
scale, setScale, Volume
· setScale
 public void setScale(int scale)
Set the scale we are printing in.

Parameters:
scale - The type of scale that is used.
See Also:
scale, getScale, Volume
· propertyLoad
 public void propertyLoad(Properties p,
                          String name) throws IllegalArgumentException
Load information from properties to this item.


All Packages  Class Hierarchy  This Package  Previous  Next  Index