/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultQuantitativeResult}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultQuantitativeResult} instance is created using the * {@linkplain #DefaultQuantitativeResult(QuantitativeResult) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultQuantitativeResult castOrCopy(final QuantitativeResult object) { if (object == null || object instanceof DefaultQuantitativeResult) { return (DefaultQuantitativeResult) object; } return new DefaultQuantitativeResult(object); }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultQuantitativeResult}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultQuantitativeResult} instance is created using the * {@linkplain #DefaultQuantitativeResult(QuantitativeResult) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultQuantitativeResult castOrCopy(final QuantitativeResult object) { if (object == null || object instanceof DefaultQuantitativeResult) { return (DefaultQuantitativeResult) object; } return new DefaultQuantitativeResult(object); }
record.setAll(accuracy); final DefaultQuantitativeResult result = new DefaultQuantitativeResult(); result.setValues(Collections.singletonList(record));
record.setAll(accuracy); final DefaultQuantitativeResult result = new DefaultQuantitativeResult(); result.setValues(Collections.singletonList(record));
/** * Evaluates the quality of this attribute with a custom rule. */ @Override public DataQuality quality() { final DefaultDataQuality quality = (DefaultDataQuality) super.quality(); final DefaultDomainConsistency report = new DefaultDomainConsistency(); final DefaultQuantitativeResult result = new DefaultQuantitativeResult(); result.setErrorStatistic(new SimpleInternationalString(ADDITIONAL_QUALITY_INFO)); report.setMeasureIdentification(NamedIdentifier.castOrCopy(getName())); report .setResults(singleton(result)); quality.setReports(singleton(report)); return quality; } }