-
Notifications
You must be signed in to change notification settings - Fork 4
Usage notes
Dmitry Avtonomov edited this page Aug 18, 2017
·
2 revisions
When dealing with mzIdentML files (.mzid) you will encounter AbstractParamType.
In the definition of mzIdentML both cvParam and userParam inherit from it
and both cvParam and userParam can be stored in the same list. Thus, when
you get such a list, you'll need to cast manually to the concrete type like so:
List<AbstractParamType> paramGroup = blabla.getParamGroup();
for (AbstractParamType param : paramGroup) {
if (param instanceof CVParamType) {
CVParamType p = (CVParamType)param;
// do something with cvParam
} else if (param instanceof UserParamType) {
UserParamType p = (UserParamType)param;
// do something with userParam
}
}