Java Reference
In-Depth Information
Mapping
JavaFX has ten basic types:
Number
,
Double
,
Float
,
Long
,
Integer
,
Short
,
Byte
,
Character
,
Boolean
, and
String
. The preferred types for normal use are
Number
,
Integer
,
Boolean
, and
String
. Unless you have a specific need for the
other types, stick with the preferred types. All these types are represented by cor-
responding Java classes and therefore have access to the corresponding Java
methods available to them. For example, the following illustrates use of the
Character
class method,
isWhiteSpace()
, and the
Integer
class
compareTo()
method.
var aCharacter:Character = 0x20;
println(aCharacter.isWhitespace(aCharacter));
var aInteger:Integer = 1000;
println(aInteger.compareTo(25));
Table 11.1 maps the JavaFX type to its corresponding Java type.
Ta b l e 1 1 . 1
JavaFX Types - Classes
JavaFX Type
Java Class
Double
java.lang.Double
Number
java.lang.Number
Float
java.lang.Float
Long
java.lang.Long
Integer
java.lang.Integer
Short
java.lang.Short
Byte
java.lang.Byte
Character
java.lang.Character
Boolean
java.lang.Boolean
String
java.lang.String
Search WWH ::
Custom Search