Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "EDT:EGL Language Primitive Types"

Line 3: Line 3:
 
== Primitive Types (Table 3)  ==
 
== Primitive Types (Table 3)  ==
  
{| width="400" cellspacing="1" cellpadding="1" border="1"
+
{| border="1" cellspacing="1" cellpadding="1" width="400"
 
|-
 
|-
 
| bgcolor="#999999" align="center" | '''''Primitive Types'''''  
 
| bgcolor="#999999" align="center" | '''''Primitive Types'''''  
 
| bgcolor="#999999" align="center" | '''Value or Reference?<sup>9</sup>'''  
 
| bgcolor="#999999" align="center" | '''Value or Reference?<sup>9</sup>'''  
 
| 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>'''
 
| bgcolor="#999999" align="center" | '''Java'''
 
| bgcolor="#999999" align="center" | '''Java'''
 
|-
 
|-
Line 14: Line 14:
 
| reference  
 
| reference  
 
| <br>done  
 
| <br>done  
| <br>  
+
| <br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 20: Line 20:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 26: Line 26:
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <br>1d  
 
| <br>1d  
| <br>  
+
| <br>
 
|  
 
|  
 
1d  
 
1d  
  
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352364 Limited string support]  
+
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352364 Limited string support]
  
 
|-
 
|-
Line 36: Line 36:
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <br>1d  
 
| <br>1d  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
| bgcolor="#cccccc" | ''Date<sup>1</sup>''<br>  
+
| bgcolor="#cccccc" | ''Date<sup>1</sup>''<br>
| value<br>  
+
| value<br>
 
| <br>done  
 
| <br>done  
| <br>  
+
| <br>
 
|  
 
|  
 
1d  
 
1d  
  
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352632 Date support]  
+
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352632 Date support]
  
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Timestamp(''pattern'')<sup>1</sup>''  
 
| bgcolor="#cccccc" | ''Timestamp(''pattern'')<sup>1</sup>''  
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
| <br>d
+
| <br>done
| <br>  
+
| <br>
 
|  
 
|  
 
0.5d  
 
0.5d  
  
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352366 Timestamp with pattern support]  
+
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352366 Timestamp with pattern support]
  
 
|-
 
|-
Line 62: Line 62:
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <br>1d  
 
| <br>1d  
| <br>  
+
| <br>
 
|  
 
|  
 
0.5d  
 
0.5d  
  
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352365 Timestamp without pattern support]  
+
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352365 Timestamp without pattern support]
  
 
|-
 
|-
Line 72: Line 72:
 
| reference  
 
| reference  
 
| <br>done  
 
| <br>done  
| N/S<br>  
+
| N/S<br>
 
|  
 
|  
1d
+
1d  
  
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352367 Blob support]
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352367 Blob support]
Line 82: Line 82:
 
| reference  
 
| reference  
 
| <br>done  
 
| <br>done  
| N/S<br>  
+
| N/S<br>
 
|  
 
|  
1d
+
1d  
  
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352368 Clob support]
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352368 Clob support]
Line 92: Line 92:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 98: Line 98:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 104: Line 104:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 110: Line 110:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 116: Line 116:
 
| reference  
 
| reference  
 
| <br>1d  
 
| <br>1d  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 122: Line 122:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 128: Line 128:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>done  
 
| <br>done  
| done<br>  
+
| done<br>
 
| done<br>
 
| done<br>
 
|-
 
|-
Line 134: Line 134:
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <span style="background: rgb(255,165,0)">reference</span>  
 
| <br>1d  
 
| <br>1d  
| done<br>  
+
| done<br>
 
|  
 
|  
1d
+
1d  
  
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352370 Generic number support]
 
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352370 Generic number support]
Line 144: Line 144:
 
| value<sup>8</sup>  
 
| value<sup>8</sup>  
 
| <br>2d  
 
| <br>2d  
| <br>  
+
| <br>
 
|  
 
|  
 
0.5d  
 
0.5d  
  
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352371 Bytes with length support]  
+
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352371 Bytes with length support]
  
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Bytes''<sup>''5''</sup>  
 
| bgcolor="#cccccc" | ''Bytes''<sup>''5''</sup>  
 
| reference  
 
| reference  
| 1d<br>  
+
| 1d<br>
| <br>  
+
| <br>
 
|  
 
|  
 
0.5d  
 
0.5d  
  
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352372 Bytes without length support]  
+
[https://bugs.eclipse.org/bugs/show_bug.cgi?id=352372 Bytes without length support]
  
 
|-
 
|-
| bgcolor="#cccccc" | ''Char''<br>  
+
| bgcolor="#cccccc" | ''Char''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Dbchar''<br>  
+
| bgcolor="#cccccc" | ''Dbchar''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Mbchar''<br>  
+
| bgcolor="#cccccc" | ''Mbchar''<br>
| <br>  
+
| <br>
| done<br>  
+
| done<br>
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Unicode''<br>  
+
| bgcolor="#cccccc" | ''Unicode''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Hex''<sup>''4''</sup><br>  
+
| bgcolor="#cccccc" | ''Hex''<sup>''4''</sup><br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Time''<sup>''1''</sup><br>  
+
| bgcolor="#cccccc" | ''Time''<sup>''1''</sup><br>
| <br>  
+
| <br>
 
| <br>1d  
 
| <br>1d  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Interval''<sup>''1''</sup><br>  
+
| bgcolor="#cccccc" | ''Interval''<sup>''1''</sup><br>
| <br>  
+
| <br>
 
| <br>1d  
 
| <br>1d  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Bin''<br>  
+
| bgcolor="#cccccc" | ''Bin''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Num''<br>  
+
| bgcolor="#cccccc" | ''Num''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Numc''<br>  
+
| bgcolor="#cccccc" | ''Numc''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Pacf''<br>  
+
| bgcolor="#cccccc" | ''Pacf''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
 
| N/S
 
| N/S
 
|-
 
|-
| bgcolor="#cccccc" | ''Money''<br>  
+
| bgcolor="#cccccc" | ''Money''<br>
| <br>  
+
| <br>
 
| <br>done  
 
| <br>done  
 
| N/S  
 
| N/S  
Line 234: Line 234:
 
|}
 
|}
  
'''Notes on Table 3'''<br>  
+
'''Notes on Table 3'''<br>
  
 
#Date and timestamp are the only supported date/time types. Use a timestamp in place of RBD's time, and use a numeric type in place of RBD's interval.  
 
#Date and timestamp are the only supported date/time types. Use a timestamp in place of RBD's time, and use a numeric type in place of RBD's interval.  
Line 240: Line 240:
 
#<span style="background: 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: 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: rgb(255,165,0)">Timestamp with no pattern is a reference type in EDT.&nbsp; It can hold any timestamp value.</span>  
 
#<span style="background: rgb(255,165,0)">Timestamp with no pattern is a reference type in EDT.&nbsp; 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).  

Revision as of 09:58, 21 July 2011

Please see the parent of this page, EDT:EGL Language.

Primitive Types (Table 3)

Primitive Types Value or Reference?9 Core JavaScript
Nullable Types
Java
Any reference
done

done
Boolean value8
done
done
done
String(N) reference
1d

1d

Limited string support

String reference
1d
done
done
Date1
value

done

1d

Date support

Timestamp(pattern)1 value8
done

0.5d

Timestamp with pattern support

Timestamp1,6 reference
1d

0.5d

Timestamp without pattern support

Blob reference
done
N/S

1d

Blob support

Clob reference
done
N/S

1d

Clob support

Smallint value8
done
done
done
Int value8
done
done
done
Bigint value8
done
done
done
Decimal(N,M)7 value8
done
done
done
Decimal2 reference
1d
done
done
Float value8
done
done
done
Smallfloat value8
done
done
done
Number3 reference
1d
done

1d

Generic number support

Bytes(N)4 value8
2d

0.5d

Bytes with length support

Bytes5 reference 1d

0.5d

Bytes without length support

Char


done
N/S N/S
Dbchar


done
N/S N/S
Mbchar

done
N/S N/S
Unicode


done
N/S N/S
Hex4


done
N/S N/S
Time1


1d
N/S N/S
Interval1


1d
N/S N/S
Bin


done
N/S N/S
Num


done
N/S N/S
Numc


done
N/S N/S
Pacf


done
N/S N/S
Money


done
N/S N/S

Notes on Table 3

  1. Date and timestamp are the only supported date/time types. Use a timestamp in place of RBD's time, and use a numeric type in place of RBD's interval.
  2. Decimal with no length or decimals is a reference type with an immutable value.
  3. Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.
  4. 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.)
  5. Bytes with no length is a reference type with an immutable value of any length.
  6. Timestamp with no pattern is a reference type in EDT.  It can hold any timestamp value.
  7. 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).
  8. Value types may be nullable.
  9. Value typed variables may be declared with a question mark following the name of the type to indicate that they're nullable. Nullability means that a variable may really be null. It's not an "I'm null" flag like in RBD. A NullValueException will be thrown if you try to access a field or function of a null variable, even a record. A NullValueException will be thrown if a null variable is an operand to a math operator, an array access, a substring access, a comparison, or a bitwise operator. The string concatenation operators will work the same as in RBD with respect to nulls. :: treats null as the empty string, and ?: results in null if either operand is null. A question mark won't be allowed on the second operand of the AS and ISA operators (the name of the type).

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).

Back to the top