/** * Gets the symbol for the unit. * * @return The symbol of the unit. May be <code>null</code>. */ public final String getSymbol() { return id == null ? null : id.getSymbol(); }
/** * Gets the symbol for the unit. * * @return The symbol of the unit. May be <code>null</code>. */ public final String getSymbol() { return id == null ? null : id.getSymbol(); }
/** * Returns the string representation of this identifier. * * @return The string representation of this identifier. */ @Override public final String toString() { final String string = getSymbol(); return string == null ? getName() : string; }
/** * Returns the string representation of this identifier. * * @return The string representation of this identifier. */ @Override public final String toString() { final String string = getSymbol(); return string == null ? getName() : string; }
/** * Constructs from identifiers and a base quantity. * * @param id * The identifiers for the base unit. <code> * id.getSymbol()</code> * shall not return <code> * null</code>. * @param baseQuantity * The base quantity of the base unit. * @throws NameException * <code>id.getSymbol()</code> returned <code> * null</code>. */ protected BaseUnit(final UnitName id, final BaseQuantity baseQuantity) throws NameException { super(id); if (id.getSymbol() == null) { throw new NameException("Base unit must have symbol"); } setDimension(new UnitDimension(this)); this.baseQuantity = baseQuantity; }
/** * Constructs from identifiers and a base quantity. * * @param id * The identifiers for the base unit. <code> * id.getSymbol()</code> * shall not return <code> * null</code>. * @param baseQuantity * The base quantity of the base unit. * @throws NameException * <code>id.getSymbol()</code> returned <code> * null</code>. */ protected BaseUnit(final UnitName id, final BaseQuantity baseQuantity) throws NameException { super(id); if (id.getSymbol() == null) { throw new NameException("Base unit must have symbol"); } setDimension(new UnitDimension(this)); this.baseQuantity = baseQuantity; }