Type Coercion"

From Documentation
m (Created page with '{{ZUMLReferencePageHeader}} EL expressions will coerce the type automatically. Here is the summary of the coercion rules. {| border='1px' | width="100%" ! !! Boolean !! Charac…')
 
m
Line 28: Line 28:
 
| obj.charAt(0)
 
| obj.charAt(0)
 
| Number<ref>The real class is determined at run time, such as Integer and Float.</ref>.valueOf(x)
 
| Number<ref>The real class is determined at run time, such as Integer and Float.</ref>.valueOf(x)
| --
+
| obj
 
|-
 
|-
 
| String (empty)
 
| String (empty)

Revision as of 02:39, 8 December 2010



EL expressions will coerce the type automatically. Here is the summary of the coercion rules.

Boolean Character Number String
Boolean obj[1] ERROR ERROR obj.toString()
Character ERROR obj (short)obj obj.toString()
Number obj ERROR (char)obj obj.toString()
String (not empty) Boolean.valueOf(obj) obj.charAt(0) Number[2].valueOf(x) obj
String (empty) false (char)0 0 obj
null false (char)0 0 ""
Other ERROR ERROR ERROR obj.toString()

  1. obj represents the object being corerced
  2. The real class is determined at run time, such as Integer and Float.

Version History

Last Update : 2010/12/08


Version Date Content
     



Last Update : 2010/12/08

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.