1 9 package org.jscience.physics.units; 10 11 import org.jscience.physics.quantities.Quantity; 12 13 26 class AlternateUnit<Q extends Quantity> extends DerivedUnit<Q> { 27 28 36 protected AlternateUnit(String symbol, Unit<? super Q> parentUnit, 37 Converter toParentUnit) { 38 _symbol = symbol; 39 _parentUnit = parentUnit; 40 _toParentUnit = toParentUnit; 41 } 42 43 48 public final String getSymbol() { 49 return _symbol; 50 } 51 52 protected boolean equalsImpl(Object that) { 54 return (that instanceof AlternateUnit) && 55 ((AlternateUnit)that)._symbol.equals(_symbol) && 56 (((AlternateUnit)that)._parentUnit == _parentUnit)&& 57 (((AlternateUnit)that)._toParentUnit == _toParentUnit); 58 } 59 60 protected int hashCodeImpl() { 62 return _symbol.hashCode(); 63 } 64 65 protected final Unit<? super Q> getParentUnitImpl() { 67 return _parentUnit; 68 } 69 70 protected final Converter toParentUnitImpl() { 72 return _toParentUnit; 73 } 74 75 private static final long serialVersionUID = 1L; 76 } | Popular Tags |