DESY ACOP Beans Home

com.cosylab.gui.components.numberfield
Class DefaultNumberDescriptor

java.lang.Object
  extended by com.cosylab.gui.components.numberfield.DefaultNumberDescriptor
All Implemented Interfaces:
NumberDescriptor

public class DefaultNumberDescriptor
extends java.lang.Object
implements NumberDescriptor

DefaultNumberDescriptor is a default implementaion of the NumberDescriptor interface.

Version:
$Revision: 1.8 $
Author:
$Author: jbobnar $

Field Summary
static java.lang.String DESCRIPTION
           
static java.lang.String NAME
           
 
Constructor Summary
DefaultNumberDescriptor()
           
 
Method Summary
 java.lang.String getFormat()
          Returns the format
 java.lang.Class getNumberType()
          Returns last set number type.
 java.lang.Number parseNumber(java.lang.String number)
          Parses string and creates Number.
 java.lang.String printEditString(java.lang.Number number)
          Converts provided Number to a string, which is displayed when NumberField enters in to edit mode and wants to edit value.
 java.lang.String printString(java.lang.Number number)
          Converts provided Number to a string, which is used for displaying the value.
 void setFormat(java.lang.String format)
          Set the Number format
 void setNumberType(java.lang.Class newClass)
          Supported types are Double.class and Long.class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
NumberDescriptor, Constant Field Values

DESCRIPTION

public static final java.lang.String DESCRIPTION
See Also:
NumberDescriptor, Constant Field Values
Constructor Detail

DefaultNumberDescriptor

public DefaultNumberDescriptor()
Method Detail

parseNumber

public java.lang.Number parseNumber(java.lang.String number)
Description copied from interface: NumberDescriptor
Parses string and creates Number. If string is not presentation of a number and can not be parsed, then null must be returned.

Specified by:
parseNumber in interface NumberDescriptor
Parameters:
number - a string representing a number
Returns:
instance of Number or null if string can not be parsed

printString

public java.lang.String printString(java.lang.Number number)
Description copied from interface: NumberDescriptor
Converts provided Number to a string, which is used for displaying the value.

Specified by:
printString in interface NumberDescriptor
Parameters:
number - a number to be transformed to string
Returns:
a String representing a number.

printEditString

public java.lang.String printEditString(java.lang.Number number)
Description copied from interface: NumberDescriptor
Converts provided Number to a string, which is displayed when NumberField enters in to edit mode and wants to edit value. Edit string is usually stripped from unnecessary characters and prepared for easyer user editing.

Specified by:
printEditString in interface NumberDescriptor
Parameters:
number - a number to be transformed to string
Returns:
a String representation a number prepared for editing.

getFormat

public java.lang.String getFormat()
Description copied from interface: NumberDescriptor
Returns the format

Specified by:
getFormat in interface NumberDescriptor
Returns:
Format

setFormat

public void setFormat(java.lang.String format)
Description copied from interface: NumberDescriptor
Set the Number format

Specified by:
setFormat in interface NumberDescriptor

setNumberType

public void setNumberType(java.lang.Class newClass)
Supported types are Double.class and Long.class.

Specified by:
setNumberType in interface NumberDescriptor
Parameters:
newClass - number type
See Also:
NumberDescriptor.setNumberType(java.lang.Class)

getNumberType

public java.lang.Class getNumberType()
Description copied from interface: NumberDescriptor
Returns last set number type.

Specified by:
getNumberType in interface NumberDescriptor
Returns:
last set number type


Copyright © 2010. All Rights Reserved.