static private BaselineStratum getBaselineStratum(BaseCumHazardTables baseCumHazardTables, FieldValue value){ if(baseCumHazardTables instanceof HasParsedValueMapping){ HasParsedValueMapping<?> hasParsedValueMapping = (HasParsedValueMapping<?>)baseCumHazardTables; return (BaselineStratum)value.getMapping(hasParsedValueMapping); } List<BaselineStratum> baselineStrata = baseCumHazardTables.getBaselineStrata(); for(BaselineStratum baselineStratum : baselineStrata){ String category = baselineStratum.getValue(); if(category == null){ throw new MissingAttributeException(baselineStratum, PMMLAttributes.BASELINESTRATUM_VALUE); } // End if if(value.equalsString(category)){ return baselineStratum; } } return null; }
static private TargetValueCounts getTargetValueCounts(BayesInput bayesInput, FieldValue value){ if(bayesInput instanceof HasParsedValueMapping){ HasParsedValueMapping<?> hasParsedValueMapping = (HasParsedValueMapping<?>)bayesInput; return (TargetValueCounts)value.getMapping(hasParsedValueMapping); } List<PairCounts> pairCounts = bayesInput.getPairCounts(); for(PairCounts pairCount : pairCounts){ String category = pairCount.getValue(); if(category == null){ throw new MissingAttributeException(pairCount, PMMLAttributes.PAIRCOUNTS_VALUE); } // End if if(value.equalsString(category)){ TargetValueCounts targetValueCounts = pairCount.getTargetValueCounts(); if(targetValueCounts == null){ throw new MissingElementException(pairCount, PMMLElements.PAIRCOUNTS_TARGETVALUECOUNTS); } return targetValueCounts; } } return null; }
Value pmmlValue = (Value)fieldValue.getMapping(hasParsedValueMapping); if(pmmlValue != null && (Value.Property.VALID).equals(pmmlValue.getProperty())){ return pmmlValue;
FieldValue fieldValue = FieldValueUtil.createOrCast(dataType, opType, value); Value pmmlValue = (Value)fieldValue.getMapping(hasParsedValueMapping); if(pmmlValue != null){ return pmmlValue.getProperty();