/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns the string representation of this unit. * * @return The string representation of this unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns a string representation of this unit. If the symbol or name is * available, then that is returned; otherwise, the corresponding expression * in base units is returned. * * @return The string expression for this derived unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns a string representation of this unit. If the symbol or name is * available, then that is returned; otherwise, the corresponding expression * in base units is returned. * * @return The string expression for this derived unit. */ @Override public String toString() { final String string = super.toString(); // get symbol or name return string != null ? string : getCanonicalString(); }
/** * Returns a label for a quantity in this unit. * * @param quantityID * The identifier for the quantity (e.g. "altitude"). * @return The appropriate label (e.g. "altitude/m"). */ public String makeLabel(final String quantityID) { final StringBuilder buf = new StringBuilder(quantityID); if (quantityID.contains(" ")) { buf.insert(0, '(').append(')'); } buf.append('/'); final int start = buf.length(); buf.append(toString()); if (buf.substring(start).indexOf(' ') != -1) { buf.insert(start, '(').append(')'); } return buf.toString(); } }
/** * Returns a label for a quantity in this unit. * * @param quantityID * The identifier for the quantity (e.g. "altitude"). * @return The appropriate label (e.g. "altitude/m"). */ public String makeLabel(final String quantityID) { final StringBuilder buf = new StringBuilder(quantityID); if (quantityID.contains(" ")) { buf.insert(0, '(').append(')'); } buf.append('/'); final int start = buf.length(); buf.append(toString()); if (buf.substring(start).indexOf(' ') != -1) { buf.insert(start, '(').append(')'); } return buf.toString(); } }