Previous Next Contents Index


GXVAL class (deprecated)

GXVAL is deprecated and is provided for backward compatibility only. New Java applications should use the standard servlet-JSP programming model.

For information about replacing GXVAL functionality in existing applications, see the Migration Guide.

The GXVAL class represents a single value of a particular data type. Parameters that are passed to an AppLogic, or results that are retrieved from an AppLogic, are contained in an IValList object that contains one or more GXVAL objects.

Typically, you do not need to use the GXVAL class directly. Generally, you use the getVal***( ) and setVal***( ) suite of methods in the IValList interface to access values in an IValList object. Using the getVal***( ) and setVal***( ) methods in IValList, you can access values of type integer, string, and BLOB in an IValList object. To access more types, such as float or double, use the GXVAL class.

The following example shows how you create a GXVAL object of type double:

import com.kivasoft.types.*;

GXVAL v;
v = new GXVAL();
// Set the member variable vt to the double type
v.vt = GXVALTYPE_ENUM.GXVT_R8;
// Call the accessor method for the double type. The member
// variable u holds the value and has accessor methods.
v.u.dblVal(123.45);
To create a GXVAL object of a different type, change the GXVALTYPE_ENUM value and the accessor method.

The following table lists the accessor methods and corresponding GXVAL types.

Java type
Accessor method
GXVAL type
char
cVal( )
GXVT_I1
int
iVal( )
GXVT_I2
int
lVal( )
GXVT_I4
float
fltVal( )
GXVT_R4
double
dblVal( )
GXVT_R8
boolean
boolVal( )
GXVT_BOOL
char
bVal( )
GXVT_UI1
int
uiVal( )
GXVT_UI2
int
ulVal( )
GXVT_UI4
java.lang.string
pstrVal( )
GXVT_LPSTR
byte[ ]
pbyteVal( )
GXVT_BLOB
int
pvoidVal( )
GXVT_VOID

Package
com.kivasoft.types

Example
import com.kivasoft.types.*;


IValList vallist = GX.CreateValList();
GXVAL x = new GXVAL();
x.vt = GXVALTYPE_ENUM.GXVT_R8;
x.u.dblVal(123.45);
vallist.setVal("test", x);

GXVAL y;
y = vallist.getVal("test");
if (y.vt == GXVALTYPE_ENUM.GXVT_R8 && y.u.dblVal() == 123.45){
//success
}
 

© Copyright 1999 Netscape Communications Corp.