There is a wide variety of datatypes across all of the Vision Module's components. Here are the most common types that you'll find.
Numeric Types
Boolean
|
A true/false value. Modeled as 0/1 in Python. Technically, 0 is false and anything else is true.
|
Short
|
A 16-bit signed integer. Can hold values between -215 and 215-1.
Thats -32,768 to 32,767, inclusive
|
Integer / int
|
A 32-bit signed integer. Can hold values between -231 and 231-1.
Thats -2,147,483,648 to 2,147,483,647 inclusive
|
Long
|
A 64-bit signed integer. Can hold values between -263 and 263-1.
Thats -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 inclusive
|
Float
|
A 32-bit signed floating point number in IEEE 754 format.
|
Double
|
A 64-bit signed floating point number in IEEE 754 format.
|
Non-Numeric Types
String
|
A string of characters. Uses UTF-16 format internally to represent the characters.
|
Color
|
A color, in the RGBA color space. Colors can easily be made dynamic or animated using Property Bindings or Styles
|
Date
|
Represents a point it time with millisecond precision. Internally stored as the number of milliseconds that have passed since the "epoch", Jan 1st 1970, 00:00:00 UTC.
|
Dataset
|
A complex datastructure that closely mimics the structure of a database table. A Dataset is a two-dimensional matrix (a.k.a. a table) of data organized in columns and rows. Each column has a name and a datatype.
|
Font
|
A typeface. Each typeface has a name, size, and style.
|
Border
|
A component border is a visual decoration around the component's edges. You can make a border dynamic by using Styles or the toBorder expression.
|
Whats the difference: Integer vs int? The difference is that an Integer property will accept the special null (or None in Python-speak) value, while an int property will not. This distinction holds true for all of the numeric types: the type name that starts with a capital letter accepts null, while the all-lowercase version does not.
Expert Tip: Most of these datatypes are actually defined by Java. For example, the Date datatype is really an instance of a java.util.Date. This means that you can use the java.util.Calendar class to manipulate them, and the java.text.SimpleDateFormat class to format and parse them. Learn more about these classes in the Java 2 Platform online documentation at http://java.sun.com/j2se/1.5.0/docs/api/index.html
See also:
Working with Different Datatypes
|