public static String getParameterValueAsString(Parameter param){ if (param == null){ return null; } return param.getValue().toString() + (param.getUncertainty() != null ? " ~" + param.getUncertainty().toString() : ""); }
public DefaultParameter(CvTerm type, String value) throws IllegalParameterException { if (type == null){ throw new IllegalArgumentException("The parameter type is required and cannot be null"); } this.type = type; Parameter param = ParameterUtils.createParameterFromString(type, value); this.value = param.getValue(); this.uncertainty = param.getUncertainty(); }
BigDecimal uncertainty1 = parameter1.getUncertainty(); BigDecimal uncertainty2 = parameter2.getUncertainty(); if (uncertainty1 == null && uncertainty2 == null){ return EQUAL;
BigDecimal uncertainty1 = parameter1.getUncertainty(); BigDecimal uncertainty2 = parameter2.getUncertainty(); if (uncertainty1 == null && uncertainty2 == null){ return true;
/** * * @param param * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Parameter param){ if (unambiguousParameterComparator == null){ unambiguousParameterComparator = new UnambiguousParameterComparator(); } if (param == null){ return 0; } int hashcode = 31; CvTerm type = param.getType(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(type); CvTerm unit = param.getUnit(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(unit); ParameterValue value = param.getValue(); hashcode = 31*hashcode + ParameterValueComparator.hashCode(value); BigDecimal uncertainty = param.getUncertainty(); hashcode = 31*hashcode + (uncertainty != null ? uncertainty.hashCode() : 0); return hashcode; } }