/** * Raises this unit dimension to a power. * @param power The power. * @return The result of raising this unit dimension * to the power. */ public UnitDimension raiseTo(int power) { return new UnitDimension(pow(power)); }
/** * Raises this unit dimension to a power. * @param power The power. * @return The result of raising this unit dimension * to the power. */ public UnitDimension raiseTo(int power) { return new UnitDimension(pow(power)); }
/** * Constructs a dimensionless derived unit from nothing. */ protected DerivedUnitImpl() { // dimensionless derived unit this(new UnitDimension(), dimensionlessID()); }
/** * Constructs a dimensionless derived unit from nothing. */ protected DerivedUnitImpl() { // dimensionless derived unit this(new UnitDimension(), dimensionlessID()); }
/** * Multiplies this unit dimension by another. * @param that The other unit dimension. * @return The product of this unit dimension multiplied * by the other. */ public UnitDimension multiplyBy(UnitDimension that) { return new UnitDimension(mult(that)); }
/** * Multiplies this unit dimension by another. * @param that The other unit dimension. * @return The product of this unit dimension multiplied * by the other. */ public UnitDimension multiplyBy(UnitDimension that) { return new UnitDimension(mult(that)); }
new UnitDimension() + '"'); UnitDimension timeDimension = new UnitDimension( BaseUnit.getOrCreate( UnitName.newUnitName("second", null, "s"), System.out.println("timeDimension = \"" + timeDimension + '"'); UnitDimension lengthDimension = new UnitDimension( BaseUnit.getOrCreate( UnitName.newUnitName("meter", null, "m"),
new UnitDimension() + '"'); UnitDimension timeDimension = new UnitDimension( BaseUnit.getOrCreate( UnitName.newUnitName("second", null, "s"), System.out.println("timeDimension = \"" + timeDimension + '"'); UnitDimension lengthDimension = new UnitDimension( BaseUnit.getOrCreate( UnitName.newUnitName("meter", null, "m"),
/** * 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; }