BrightSide Workbench Full Report + Source Code
org.turro.zkoss.input.ExpressionInput Class Reference
Inheritance diagram for org.turro.zkoss.input.ExpressionInput:
Collaboration diagram for org.turro.zkoss.input.ExpressionInput:

Public Member Functions

Object getNumber () throws WrongValueException
 
Object getNumber (int precision) throws WrongValueException
 
double getDoubleValue ()
 
void setValue (Object value) throws WrongValueException
 
String getFormat ()
 
void setFormat (String format)
 

Protected Member Functions

Object coerceFromString (String value) throws WrongValueException
 
String coerceToString (Object value)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file ExpressionInput.java.

Member Function Documentation

◆ coerceFromString()

Object org.turro.zkoss.input.ExpressionInput.coerceFromString ( String  value) throws WrongValueException
protected

Definition at line 53 of file ExpressionInput.java.

53  {
54  return Script.formatInput(new Script().evalToDouble(value), format == null ? "0.########" : format);
55  }

◆ coerceToString()

String org.turro.zkoss.input.ExpressionInput.coerceToString ( Object  value)
protected

Definition at line 58 of file ExpressionInput.java.

58  {
59  return Script.formatInput(value, format == null ? "0.########" : format);
60  }
Here is the caller graph for this function:

◆ getDoubleValue()

double org.turro.zkoss.input.ExpressionInput.getDoubleValue ( )

Definition at line 40 of file ExpressionInput.java.

40  {
41  Object n = (Object) getNumber();
42  if(n instanceof Number) {
43  return ((Number) n).doubleValue();
44  }
45  return 0.0d;
46  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFormat()

String org.turro.zkoss.input.ExpressionInput.getFormat ( )

Definition at line 62 of file ExpressionInput.java.

62  {
63  return format;
64  }

◆ getNumber() [1/2]

Object org.turro.zkoss.input.ExpressionInput.getNumber ( ) throws WrongValueException

Definition at line 32 of file ExpressionInput.java.

32  {
33  return new Script().evalToDouble(getText());
34  }
Here is the caller graph for this function:

◆ getNumber() [2/2]

Object org.turro.zkoss.input.ExpressionInput.getNumber ( int  precision) throws WrongValueException

Definition at line 36 of file ExpressionInput.java.

36  {
37  return new Script().evalToDouble(getText(), precision);
38  }

◆ setFormat()

void org.turro.zkoss.input.ExpressionInput.setFormat ( String  format)

Definition at line 66 of file ExpressionInput.java.

66  {
67  this.format = format;
68  }

◆ setValue()

void org.turro.zkoss.input.ExpressionInput.setValue ( Object  value) throws WrongValueException

Definition at line 48 of file ExpressionInput.java.

48  {
49  setText(coerceToString(value == null ? "" : value));
50  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: