// Need to check if the IPE is corrupt
if(product instanceof CorruptIPE){
// IPE is corrupt, handle it
} else {
// Not corrupt, can determine type based on the type in the directory entry
switch(ipe.getDirEntry().getTYP()){
case 2:
Type2 type2 = (Type2) product;
// handle it
break;
case 14:
Type14 type14 = (Type14) product;
// handle it
break;
case 16:
Type16 type16 = (Type16) product;
// handle it
break;
case 22:
Type22 type22 = (Type22) product;
// handle it
break;
case 23:
Type23 type23 = (Type23) product;
// handle it
break;
case 24:
Type24 type24 = (Type24) product;
// handle it
break;
case 27:
Type27 type27 = (Type27) product;
// handle it
break;
case 28:
Type28 type28 = (Type28) product;
// handle it
break;
case 29:
Type29 type29 = (Type29) product;
// handle it
break;
default:
// IPE is not of a supported type
UnsupportedIPE unsupported = (UnsupportedIPE) product;
// handle it
break;
}
}