/** * <p> * Checks if this value is equal to the reference value. * </p> */ public boolean equals(HasValue<?> hasValue){ if(hasValue instanceof HasParsedValue){ HasParsedValue<?> hasParsedValue = (HasParsedValue<?>)hasValue; return equals(hasParsedValue); } return equalsString(ensureValue(hasValue)); }
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; }
if(value.equalsString(category)){ result.add(id);
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; }
FieldValue fieldValue = (FieldValue)value; equals = fieldValue.equalsString(stringValue); } else