EDOBE XDOM PMML Manuel d'utilisateur Page 64

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 98
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 63
64
if (propInfo->isPropName("seed")) {
setSeed(propInfo->getPropAsINT32());
} else if (propInfo->isPropName("total.rows")) {
setTotalRows(propInfo->getPropAsINT64());
} else {
CNKProc::setProperty(propInfo);
}
}
This code checks the property name against each of the accepted
string values, extracts the argument value as the appropriate type, and
calls an object method to set the appropriate property. If none of the
property names match, the superclass method is called to handle any
other property names.
getProperty is implemented in much the
same way:
void CNKProcRandomReader::getProperty(
CNKPropertyInfo* propInfo) {
if (propInfo->isPropName("seed")) {
propInfo->setPropAsINT32(getSeed());
} else if (propInfo->isPropName("total.rows")) {
propInfo->setPropAsINT64(getTotalRows());
} else {
CNKProc::getProperty(propInfo);
}
}
This code calls an object method to get the appropriate value, and
calls
propInfo->setPropAsXXX to set the first argument appropriately.
As with
setProperty, if none of the property names match, the
superclass method is called to handle any other property names.
One downside of the
setProperty/getProperty scheme for passing
information between Java and C++ is that the Java code needs to use
the same property names as the C++ methods (like
"total.rows" in
the example above). Maintaining consistency between the C++
property names and the ones used by the Java functions is a possible
source of error. Strictly speaking, the documentation of a subclass of
CNKObj should include documentation for the property names that it
can interpret via
get/setProperty.
Vue de la page 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 97 98

Commentaires sur ces manuels

Pas de commentaire