69
column_type_string,
column_type_timeDate};
void setColumnType(int colNum, int typeNum);
int getColumnType(int colNum);
int columnTypeIsDouble(int colNum);
int columnTypeIsFactor(int colNum);
int columnTypeIsString(long colNum);
int columnTypeIsTimeDate(long colNum);
Each column in a CNKBuf has a column type. The possible types are
identified by the integer values
CNKBuf::column_type_double,
CNKBuf::column_type_factor, CNKBuf::column_type_string, or
CNKBuf::column_type_timeDate. The type of a CNKBuf column can
be set/get with
setColumnType and getColumnType. The methods
columnTypeIsDouble, etc. return true (non-zero) if the specified
column is of type
column_type_double, etc.
If the column type is
CNKBuf::column_type_double, each value in the
column is interpreted as a floating point number. Missing values are
represented as the special
NaN value returned by
CNKObj::getDoubleNaN().
If the column type is
CNKBuf::column_type_factor, each value in the
column represents one of a list of string "factor levels", or the missing
value. The implementation is complicated. The actual values in the
CNKBuf are stored as double values (and NaN values). In order to
interpret these double values as factor levels, the
CNKBuf maintains
for each column a list of factor level strings. As new factor values are
stored, this list is grown. The actual double values stored in the
CNKBuf are the positions of the corresponding factor levels in the level
list (
0.0, 1.0, ...). Methods for accessing the factor levels for a column
are described below.
If the column type is
CNKBuf::column_type_string, each value is a
char array representing a string. Typically values are stored in the
UTF-8 format. As the pipeline itself does not manipulate the values
of the char arrays, it is possible to pass around strings using other char
array conventions.
If the column type is
CNKBuf::column_type_timeDate, each value is
stored as a long representing the number of milliseconds since an
origin of January 1, 1970. This is the same origin used by Java. The
Komentarze do niniejszej Instrukcji