/** Auxiliary for AttValPair.toString */ void toString(StringBuilder result) { if (values != null) { result.append('=').append(values.toString()); } if (metaData != null) { // add a marker indicating the presence of metadata result.append('+'); } }
/** Add another value, returning true if added (unique). */ boolean addValue(V value) { boolean result = false; if (value != null) { if (values == null) { values = new MultipleValuesContainer<V>(value); result = true; } else { result = values.addValue(value); } } return result; }
/** Get all of this instance's values. */ List<V> getValues() { return values == null ? null : values.getValues(); }
/** Get the value. */ V getValue() { return values == null ? null : values.getValue(); }
/** Remove the given value, returning true if removed (existed). */ boolean removeValue(V value) { return (values == null) ? false : values.removeValue(value); }
/** Get the number of values. */ int getValuesCount() { return values == null ? 0 : values.getValuesCount(); }
/** Determine whether there are multiple values. */ boolean hasMultipleValues() { return values != null && values.hasMultipleValues(); }