Using the INTERVAL type
When calling a Java method with an expression evaluating to an INTERVAL
,
the runtime system converts the INTERVAL
value to an
instance of the com.fourjs.fgl.lang.FglInterval
class
implemented in $FGLDIR/lib/fgl.jar. You can then
manipulate the INTERVAL
from within the Java code.
You must add $FGLDIR/lib/fgl.jar to the class
path in order to compile Java code with com.fourjs.fgl.lang.FglInterval
class.
The com.fourjs.fgl.lang.FglInterval
class implements the following:
Field | Description |
---|---|
|
Time qualifier for year |
|
Time qualifier for month |
|
Time qualifier for day |
|
Time qualifier for hour |
|
Time qualifier for minute |
|
Time qualifier for second |
|
Time qualifier for fraction (start qualifier) |
|
Time qualifier for fraction(1) (end qualifier) |
|
Time qualifier for fraction(2) (end qualifier) |
|
Time qualifier for fraction(3) (end qualifier) |
|
Time qualifier for fraction(4) (end qualifier) |
|
Time qualifier for fraction(5) (end qualifier) |
Methods | Description |
---|---|
|
Returns the encoded type qualifier for an interval with to interval
qualifiers and length passed: encoded qualifier = (length * 256) + (startUnit * 16) + endUnit Where length defines the total number of significant digits in this time data. For example, with INTERVAL DAY(5) TO FRACTION3: startUnit = DAY length = 13 (DDDDhhmmssfff) endUnit = FRACTION3 |
|
Converts the INTERVAL value
to a String object representing an interval in
default format. |
|
Creates a new DD hh:mm:ss.fff |
|
Creates a new FglDateTime object
from a String object representing an interval value
in standard format, using the qualifiers and precision passed as
parameter. |
com.fourjs.fgl.lang.FglInterval
object
as in this example:public static void useInterval(FglInterval inv) throws ParseException {
String s = inv.toString();
...
}
com.fourjs.fgl.lang.FglInterval
object in your program,
you can use the valueOf()
class method as in this
example:IMPORT JAVA com.fourjs.fgl.lang.FglInterval
MAIN
DEFINE inv com.fourjs.fgl.lang.FglInterval
LET inv = FglInterval.valueOf("-510 12:33:45.123")
DISPLAY inv.toString()
END MAIN