62
CNKPropertyInfo Information other than the actual data is stored and exchanged using
properties. A property is a name/value pair where the name uniquely
identifies the piece of information being stored, and the value is the
information being stored.
The methods
CNKObj::setProperty and CNKObj::getProperty are
used to set and get property values for an object.
One use for this is to pass parameters from Java to the C++ code
implementing the component. It may also be used to communicate
results such as numeric summaries back to the Java code after
computation is complete.
A property is stored in a
CNKPropertyInfo object. CNKPropertyInfo
is defined in CNKPropertyInfo.h with the following methods:
CNKPropertyInfo::
const char* getPropName();
int isPropName(char* name);
getPropName()
returns the property name for this object.
isPropName(char* name) compares this string to the argument
"name", returning true (non-zero) if they are the same.
CNKPropertyInfo::
virtual long getPropAsINT32();
virtual void setPropAsINT32(long val);
virtual INT64 getPropAsINT64();
virtual void setPropAsINT64(INT64 val);
double getPropAsDouble();
void setPropAsDouble(double val);
int getPropAsLogical();
void setPropAsLogical(int val);
const char* getPropAsString();
void setPropAsString(const char* val);
These methods get/set the argument to a single long, double, etc.
value.
CNKPropertyInfo::
CNKBuf* getPropAsCNKBuf();
void setPropAsCNKBuf(CNKBuf* buf);
CNKProc* getPropAsCNKProc();
void setPropAsCNKProc(CNKProc* proc);
Comentarios a estos manuales