Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EDT:EGL Language Primitive Types"
Line 1: | Line 1: | ||
− | Please see the parent of this page, [[EDT: | + | Please see the parent of this page, [[EDT:EGL Language]]. |
== Primitive Types (Table 3) == | == Primitive Types (Table 3) == | ||
Line 6: | Line 6: | ||
|- | |- | ||
| bgcolor="#999999" align="center" | '''''Primitive Types''''' | | bgcolor="#999999" align="center" | '''''Primitive Types''''' | ||
+ | | bgcolor="#999999" align="center" | '''Value or Reference?''' | ||
| bgcolor="#999999" align="center" | '''Core''' | | bgcolor="#999999" align="center" | '''Core''' | ||
| bgcolor="#999999" align="center" | '''JavaScript<br>[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352019 Nullable Types]<br>''' | | bgcolor="#999999" align="center" | '''JavaScript<br>[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352019 Nullable Types]<br>''' | ||
Line 12: | Line 13: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Any'' | | bgcolor="#cccccc" | ''Any'' | ||
+ | | reference | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
Line 18: | Line 20: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Boolean'' | | bgcolor="#cccccc" | ''Boolean'' | ||
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 24: | Line 27: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Dictionary'' | | bgcolor="#cccccc" | ''Dictionary'' | ||
+ | | reference | ||
| <br> | | <br> | ||
| [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352020 Dictionary Support]<br> | | [https://bugs.eclipse.org/bugs/show_bug.cgi?id=352020 Dictionary Support]<br> | ||
Line 29: | Line 33: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''String(N)< | + | | bgcolor="#cccccc" | ''String(N)'' |
+ | | <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">reference</span> | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
Line 35: | Line 40: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''String< | + | | bgcolor="#cccccc" | ''String'' |
+ | | <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">reference</span> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 41: | Line 47: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Timestamp(''pattern'')<sup> | + | | bgcolor="#cccccc" | ''Timestamp(''pattern'')<sup>1</sup>'' |
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
Line 47: | Line 54: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Timestamp<sup> | + | | bgcolor="#cccccc" | ''Timestamp''<sup>''1,6''</sup> |
+ | | <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">reference</span> | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
Line 54: | Line 62: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Blob'' | | bgcolor="#cccccc" | ''Blob'' | ||
+ | | reference | ||
| <br> | | <br> | ||
| N/S<br> | | N/S<br> | ||
Line 60: | Line 69: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Clob'' | | bgcolor="#cccccc" | ''Clob'' | ||
+ | | reference | ||
| <br> | | <br> | ||
| N/S<br> | | N/S<br> | ||
Line 66: | Line 76: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Smallint'' | | bgcolor="#cccccc" | ''Smallint'' | ||
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 72: | Line 83: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Int'' | | bgcolor="#cccccc" | ''Int'' | ||
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 78: | Line 90: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Bigint'' | | bgcolor="#cccccc" | ''Bigint'' | ||
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 83: | Line 96: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Decimal(N,M)<sup> | + | | bgcolor="#cccccc" | ''Decimal(N,M)''<sup>''7''</sup> |
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 89: | Line 103: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Decimal<sup> | + | | bgcolor="#cccccc" | ''Decimal<sup>2</sup><sup></sup>'' |
+ | | reference | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 96: | Line 111: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Float'' | | bgcolor="#cccccc" | ''Float'' | ||
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 102: | Line 118: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Smallfloat'' | | bgcolor="#cccccc" | ''Smallfloat'' | ||
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 107: | Line 124: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Number<sup> | + | | bgcolor="#cccccc" | ''Number''<sup>''3''</sup> |
+ | | <span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">reference</span> | ||
| <br> | | <br> | ||
| done<br> | | done<br> | ||
Line 113: | Line 131: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Bytes(N)<sup> | + | | bgcolor="#cccccc" | ''Bytes(N)''<sup>''4''</sup> |
+ | | value<sup>8</sup> | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
Line 119: | Line 138: | ||
| <br> | | <br> | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Bytes<sup> | + | | bgcolor="#cccccc" | ''Bytes''<sup>''5''</sup> |
+ | | reference | ||
| <br> | | <br> | ||
| <br> | | <br> | ||
Line 126: | Line 146: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Arraydictionary''<br> | | bgcolor="#cccccc" | ''Arraydictionary''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 132: | Line 153: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Char''<br> | | bgcolor="#cccccc" | ''Char''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 138: | Line 160: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Dbchar''<br> | | bgcolor="#cccccc" | ''Dbchar''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 144: | Line 167: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Mbchar''<br> | | bgcolor="#cccccc" | ''Mbchar''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 150: | Line 174: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Unicode''<br> | | bgcolor="#cccccc" | ''Unicode''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 155: | Line 180: | ||
| N/S | | N/S | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Hex<sup> | + | | bgcolor="#cccccc" | ''Hex''<sup>''4''</sup><br> |
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 161: | Line 187: | ||
| N/S | | N/S | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Date<sup> | + | | bgcolor="#cccccc" | ''Date''<sup>''1''</sup><br> |
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 167: | Line 194: | ||
| N/S | | N/S | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Time<sup> | + | | bgcolor="#cccccc" | ''Time''<sup>''1''</sup><br> |
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 173: | Line 201: | ||
| N/S | | N/S | ||
|- | |- | ||
− | | bgcolor="#cccccc" | ''Interval<sup> | + | | bgcolor="#cccccc" | ''Interval''<sup>''1''</sup><br> |
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 180: | Line 209: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Bin''<br> | | bgcolor="#cccccc" | ''Bin''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 186: | Line 216: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Num''<br> | | bgcolor="#cccccc" | ''Num''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 192: | Line 223: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Numc''<br> | | bgcolor="#cccccc" | ''Numc''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 198: | Line 230: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Pacf''<br> | | bgcolor="#cccccc" | ''Pacf''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 204: | Line 237: | ||
|- | |- | ||
| bgcolor="#cccccc" | ''Money''<br> | | bgcolor="#cccccc" | ''Money''<br> | ||
+ | | | ||
| <br> | | <br> | ||
| N/S | | N/S | ||
Line 212: | Line 246: | ||
'''Notes on Table 3'''<br> | '''Notes on Table 3'''<br> | ||
− | |||
− | |||
#Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval. | #Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval. | ||
− | # | + | #Decimal with no length or decimals is a reference type with an immutable value. |
#<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.</span> | #<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.</span> | ||
#Bytes(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value. (In RBD, the length of a hex is the number of nibbles not the nubmer of bytes.) | #Bytes(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value. (In RBD, the length of a hex is the number of nibbles not the nubmer of bytes.) | ||
#Bytes with no length is a reference type with an immutable value of any length.<br> | #Bytes with no length is a reference type with an immutable value of any length.<br> | ||
#<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Timestamp with no pattern is a reference type in EDT. It can hold any timestamp value.</span> | #<span style="background: none repeat scroll 0% 0% rgb(255, 165, 0);">Timestamp with no pattern is a reference type in EDT. It can hold any timestamp value.</span> | ||
− | #As in RBD, it's OK to only specify the length when using the decimal type. Decimal(N) is internally mapped to decimal(N,0). | + | #As in RBD, it's OK to only specify the length when using the decimal type. Decimal(N) is internally mapped to decimal(N,0). |
+ | #Value types may be nullable. | ||
=== More about the Bytes type === | === More about the Bytes type === |
Revision as of 10:47, 18 July 2011
Please see the parent of this page, EDT:EGL Language.
Primitive Types (Table 3)
Primitive Types | Value or Reference? | Core | JavaScript Nullable Types |
Java | Debug |
Any | reference | |
|
|
|
Boolean | value8 | |
done |
|
|
Dictionary | reference | |
Dictionary Support |
|
|
String(N) | reference | |
|
|
|
String | reference | |
done |
|
|
Timestamp(pattern)1 | value8 | |
|
|
|
Timestamp1,6 | reference | |
|
|
|
Blob | reference | |
N/S |
|
|
Clob | reference | |
N/S |
|
|
Smallint | value8 | |
done |
|
|
Int | value8 | |
done |
|
|
Bigint | value8 | |
done |
|
|
Decimal(N,M)7 | value8 | |
done |
|
|
Decimal2 | reference | |
done |
|
|
Float | value8 | |
done |
|
|
Smallfloat | value8 | |
done |
|
|
Number3 | reference | |
done |
|
|
Bytes(N)4 | value8 | |
|
|
|
Bytes5 | reference | |
|
|
|
Arraydictionary |
|
N/S | N/S | N/S | |
Char |
|
N/S | N/S | N/S | |
Dbchar |
|
N/S | N/S | N/S | |
Mbchar |
|
N/S | N/S | N/S | |
Unicode |
|
N/S | N/S | N/S | |
Hex4 |
|
N/S | N/S | N/S | |
Date1 |
|
N/S | N/S | N/S | |
Time1 |
|
N/S | N/S | N/S | |
Interval1 |
|
N/S | N/S | N/S | |
Bin |
|
N/S | N/S | N/S | |
Num |
|
N/S | N/S | N/S | |
Numc |
|
N/S | N/S | N/S | |
Pacf |
|
N/S | N/S | N/S | |
Money |
|
N/S | N/S | N/S |
Notes on Table 3
- Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval.
- Decimal with no length or decimals is a reference type with an immutable value.
- Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.
- Bytes(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value. (In RBD, the length of a hex is the number of nibbles not the nubmer of bytes.)
- Bytes with no length is a reference type with an immutable value of any length.
- Timestamp with no pattern is a reference type in EDT. It can hold any timestamp value.
- As in RBD, it's OK to only specify the length when using the decimal type. Decimal(N) is internally mapped to decimal(N,0).
- Value types may be nullable.
More about the Bytes type
Bytes is meant to hold data with no particular format.
Assignment between two bytes values with no length is a reference assignment. Assignment between two bytes values when one or both has a length is a value assignment (data is copied). If the source is longer bytes on its right side are truncated. If the source is shorter then we don't add padding: we just don't update what was there before. For example if your bytes(3) is 0x123456 and you assign it a bytes(1) value of 0x99 then the bytes(3) ends up with 0x993456.
In order for two bytes values to be compared, they must both have a size, and the sizes must be equal. The comparison is done one byte at a time, from left to right, until a difference is found. The operand with a one instead of a zero is greater.
The bytes type supports the substring operator. The type of the result is bytes (with no length).