Codota Logo
Unit.getBaseUnits
Code IndexAdd Codota to your IDE (free)

How to use
getBaseUnits
method
in
javax.measure.Unit

Best Java code snippets using javax.measure.Unit.getBaseUnits (Showing top 17 results out of 315)

  • Common ways to obtain Unit
private void myMethod () {
Unit u =
  • Codota IconQuantity quantity;quantity.getUnit()
  • Codota IconParameterDescriptor descriptor;descriptor.getUnit()
  • Codota IconCharSequence charSequence;SimpleUnitFormat.getInstance().parse(charSequence)
  • Smart code suggestions by Codota
}
origin: tec.uom/uom-se

@Override
public Map<? extends Unit<?>, Integer> getBaseUnits() {
 return parentUnit.getBaseUnits();
}
origin: tec.units/indriya

@Override
public Map<? extends Unit<?>, Integer> getBaseUnits() {
 return lower.getBaseUnits();
}
origin: tec.units/indriya

@Override
public Map<? extends Unit<?>, Integer> getBaseUnits() {
 return parentUnit.getBaseUnits();
}
origin: tec.units/unit-ri

@Override
public Map<? extends Unit<?>, Integer> getBaseUnits() {
 return actualUnit.getBaseUnits();
}
origin: tec.uom/uom-se

/**
 * Returns the fundamental (base) dimensions and their exponent whose product is this dimension or <code>null</code> if this dimension is a
 * fundamental dimension.
 *
 * @return the mapping between the base dimensions and their exponent.
 * @since 1.0
 */
@SuppressWarnings("rawtypes")
public Map<? extends Dimension, Integer> getBaseDimensions() {
 Map<? extends Unit, Integer> pseudoUnits = pseudoUnit.getBaseUnits();
 if (pseudoUnits == null)
  return null;
 final Map<QuantityDimension, Integer> baseDimensions = new HashMap<>();
 for (Map.Entry<? extends Unit, Integer> entry : pseudoUnits.entrySet()) {
  baseDimensions.put(new QuantityDimension(entry.getKey()), entry.getValue());
 }
 return baseDimensions;
}
origin: tec.units/unit-ri

/**
 * Returns the fundamental (base) dimensions and their exponent whose product is this dimension or <code>null</code> if this dimension is a
 * fundamental dimension.
 *
 * @return the mapping between the base dimensions and their exponent.
 * @since 1.0
 */
@SuppressWarnings("rawtypes")
public Map<? extends Dimension, Integer> getBaseDimensions() {
 Map<? extends Unit, Integer> pseudoUnits = pseudoUnit.getBaseUnits();
 if (pseudoUnits == null)
  return null;
 final Map<QuantityDimension, Integer> baseDimensions = new HashMap<QuantityDimension, Integer>();
 for (Map.Entry<? extends Unit, Integer> entry : pseudoUnits.entrySet()) {
  baseDimensions.put(new QuantityDimension(entry.getKey()), entry.getValue());
 }
 return baseDimensions;
}
origin: tec.units/indriya

/**
 * Returns the fundamental (base) dimensions and their exponent whose product is this dimension or <code>null</code> if this dimension is a
 * fundamental dimension.
 *
 * @return the mapping between the base dimensions and their exponent.
 * @since 1.0
 */
@SuppressWarnings("rawtypes")
public Map<? extends Dimension, Integer> getBaseDimensions() {
 Map<? extends Unit, Integer> pseudoUnits = pseudoUnit.getBaseUnits();
 if (pseudoUnits == null)
  return null;
 final Map<QuantityDimension, Integer> baseDimensions = new HashMap<>();
 for (Map.Entry<? extends Unit, Integer> entry : pseudoUnits.entrySet()) {
  baseDimensions.put(new QuantityDimension(entry.getKey()), entry.getValue());
 }
 return baseDimensions;
}
origin: tec.uom/uom-se

@SuppressWarnings("unchecked")
private static int productPrecedenceInternal(Unit<?> unit, Appendable buffer, SymbolMap symbolMap) throws IOException {
 Map<Unit<?>, Integer> productUnits = (Map<Unit<?>, Integer>) unit.getBaseUnits();
 int negativeExponentCount = 0;
origin: tec.units/indriya

@SuppressWarnings("unchecked")
private static int productPrecedenceInternal(Unit<?> unit, Appendable buffer, SymbolMap symbolMap) throws IOException {
 Map<Unit<?>, Integer> productUnits = (Map<Unit<?>, Integer>) unit.getBaseUnits();
 int negativeExponentCount = 0;
origin: apache/sis

/**
 * Tests {@link SystemUnit#getBaseUnits()}. This method indirectly tests the results of
 * {@link SystemUnit#multiply(Unit)}, {@link SystemUnit#divide(Unit)} and {@link SystemUnit#pow(int)}
 * since this test uses constants that were created with above operations.
 */
@Test
public void testGetBaseDimensions() {
  assertNull("METRE",  Units.METRE .getBaseUnits());      // Null value as per JSR-363 specification.
  assertNull("SECOND", Units.SECOND.getBaseUnits());
  assertTrue("UNITY",  Units.UNITY .getBaseUnits().isEmpty());
  assertMapEquals(Collections.singletonMap(Units.METRE, 3), Units.CUBIC_METRE.getBaseUnits());
  final Map<Unit<?>,Integer> expected = new HashMap<>(4);
  assertNull(expected.put(Units.KILOGRAM, 1));
  assertNull(expected.put(Units.METRE,    1));
  assertNull(expected.put(Units.SECOND,  -2));
  assertMapEquals(expected, Units.NEWTON.getBaseUnits());
}
origin: apache/sis

Map<? extends Unit<?>, Integer> c = unscaled.getBaseUnits();
if (c == null) c = Collections.singletonMap(unit, 1);
components = c;
origin: tec.units/indriya

 buffer.append(symbol);
 return NOOP_PRECEDENCE;
} else if (unit.getBaseUnits() != null) {
 Map<Unit<?>, Integer> productUnits = (Map<Unit<?>, Integer>) unit.getBaseUnits();
 int negativeExponentCount = 0;
origin: org.apache.sis.core/sis-utility

} else {
  components = unit.getBaseUnits();
  if (components == null) {
    components = Collections.singletonMap(unit, 1);
origin: tec.uom/uom-se

 buffer.append(symbol);
 return NOOP_PRECEDENCE;
} else if (unit.getBaseUnits() != null) {
 Map<Unit<?>, Integer> productUnits = (Map<Unit<?>, Integer>) unit.getBaseUnits();
 int negativeExponentCount = 0;
origin: tec.units/indriya

if (symbol != null) {
 return noopPrecedenceInternal(buffer, symbol);
} else if (unit.getBaseUnits() != null) {
 return productPrecedenceInternal(unit, buffer, symbolMap);
} else if (unit instanceof BaseUnit<?>) {
origin: tec.uom/uom-se

if (symbol != null) {
 return noopPrecedenceInternal(buffer, symbol);
} else if (unit.getBaseUnits() != null) {
 return productPrecedenceInternal(unit, buffer, symbolMap);
} else if (unit instanceof BaseUnit<?>) {
origin: apache/sis

/**
 * Tests {@link SystemUnit#multiply(Unit)}.
 */
@Test
@DependsOnMethod("testEqualsAndHashCode")
public void testMultiply() {
  assertSame(Units.METRE,        Units.METRE.multiply(Units.UNITY));
  assertSame(Units.SQUARE_METRE, Units.METRE.multiply(Units.METRE));
  assertSame(Units.CUBIC_METRE,  Units.METRE.multiply(Units.SQUARE_METRE));
  assertSame(Units.CUBIC_METRE,  Units.SQUARE_METRE.multiply(Units.METRE));
  final Map<Unit<?>,Integer> expected = new HashMap<>(4);
  assertNull(expected.put(Units.METRE,  1));
  assertNull(expected.put(Units.SECOND, 1));
  assertMapEquals(expected, Units.METRE.multiply(Units.SECOND).getBaseUnits());
}
javax.measureUnitgetBaseUnits

Popular methods of Unit

  • getConverterTo
  • toString
  • multiply
  • getConverterToAny
  • getSystemUnit
  • asType
  • isCompatible
  • divide
  • getSymbol
  • getDimension
  • transform
  • getName
  • transform,
  • getName,
  • pow,
  • root,
  • shift,
  • inverse,
  • alternate

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • orElseThrow (Optional)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Notification (javax.management)
  • JFrame (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now