Led Display Component v1.0
www.LedTicker.net/display

net.leddisplay.demo.tokens
Class NumberToken

java.lang.Object
  extended bynet.leddisplay.elements.Token
      extended bynet.leddisplay.demo.tokens.NumberToken

public class NumberToken
extends Token

A token representing a number


Field Summary
protected  double value
          The represented value
 
Constructor Summary
NumberToken()
          Creates a NumberToken with a default NumberFormat using the ENGLISH Locale and a two fraction digit representation
NumberToken(ColorModel colorModel)
          Creates a NumberToken with a specific ColorModel
NumberToken(java.text.NumberFormat numberFormat)
          Creates a NumberToken with the given NumberFormat
NumberToken(java.text.NumberFormat numberFormat, ColorModel colorModel)
          Creates a NumberToken with the given NumberFormat and a specific ColorModel
 
Method Summary
 java.lang.String getDisplayValue()
          Gets the representation of the number
 void setNumberFormat(java.text.NumberFormat numberFormat)
          Sets the NumberFormat used to represent the value.
 void setValue(java.lang.Object value)
          Sets the value of the token
 
Methods inherited from class net.leddisplay.elements.Token
getColorModel, setColorModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected double value
The represented value

Constructor Detail

NumberToken

public NumberToken()
Creates a NumberToken with a default NumberFormat using the ENGLISH Locale and a two fraction digit representation


NumberToken

public NumberToken(java.text.NumberFormat numberFormat)
Creates a NumberToken with the given NumberFormat

Parameters:
numberFormat - the representation's number format

NumberToken

public NumberToken(ColorModel colorModel)
Creates a NumberToken with a specific ColorModel

Parameters:
colorModel - the ColorModel

NumberToken

public NumberToken(java.text.NumberFormat numberFormat,
                   ColorModel colorModel)
Creates a NumberToken with the given NumberFormat and a specific ColorModel

Parameters:
numberFormat - the representation's number format
colorModel - the ColorModel
Method Detail

getDisplayValue

public java.lang.String getDisplayValue()
Gets the representation of the number

Specified by:
getDisplayValue in class Token
Returns:
the token's String representation
See Also:
Token.getDisplayValue()

setNumberFormat

public void setNumberFormat(java.text.NumberFormat numberFormat)
Sets the NumberFormat used to represent the value. If the given value is null a default NumberFormat is assigned, using the ENGLISH Locale and a two fraction digit representation

Parameters:
numberFormat - the new NumberFormat

setValue

public void setValue(java.lang.Object value)
Sets the value of the token

Specified by:
setValue in class Token
Parameters:
value - the token's value
Throws:
java.lang.IllegalArgumentException - if the given value is not a Number
See Also:
Token.setValue(java.lang.Object)

Led Display Component v1.0
www.LedTicker.net/display