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

How to use
getDimension
method
in
javax.measure.Unit

Best Java code snippets using javax.measure.Unit.getDimension (Showing top 20 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: eclipse/smarthome

public Dimension getDimension() {
  return getUnit().getDimension();
}
origin: eclipse/smarthome

@SuppressWarnings("unchecked")
@Override
public boolean equals(@Nullable Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof QuantityType)) {
    return false;
  }
  QuantityType<?> other = (QuantityType<?>) obj;
  if (!quantity.getUnit().getDimension().equals(other.quantity.getUnit().getDimension())) {
    return false;
  } else if (compareTo((QuantityType<T>) other) != 0) {
    return false;
  }
  return true;
}
origin: tec.units/indriya

 @Override
 public Dimension getDimension() {
  return lower.getDimension();
 }
}
origin: tec.uom/uom-se

@Override
public Dimension getDimension() {
 return parentUnit.getDimension();
}
origin: tec.units/unit-ri

@Override
public Dimension getDimension() {
 return actualUnit.getDimension();
}
origin: tec.units/indriya

@Override
public Dimension getDimension() {
 return parentUnit.getDimension();
}
origin: tec.units/unit-ri

public Set<Unit<?>> getUnits() {
 if (logger.isLoggable(Level.FINEST)) {
  for (Unit<?> u : units) {
   logger.log(Level.FINEST, u + "; D: " + u.getDimension() + "; C: " + u.getClass());
  }
 }
 return units;
}
origin: tec.units/unit-ri

static Set<Unit<?>> getUnitsOfDimension(final Set<Unit<?>> units, Dimension dimension) {
 if (dimension != null) {
  Set<Unit<?>> dimSet = new HashSet<Unit<?>>();
  for (Unit<?> u : units) {
   if (dimension.equals(u.getDimension())) {
    dimSet.add(u);
   }
  }
  return dimSet;
 }
 return null;
}
origin: tec.units/indriya

static Set<Unit<?>> getUnitsOfDimension(final Set<Unit<?>> units, Dimension dimension) {
  if (dimension != null) {
  return units.stream().filter(u -> dimension.equals(u.getDimension())).collect(Collectors.toSet());
  }
  return null;
}
origin: tec.uom/uom-se

static Set<Unit<?>> getUnitsOfDimension(final Set<Unit<?>> units, Dimension dimension) {
  if (dimension != null) {
  return units.stream().filter(u -> dimension.equals(u.getDimension())).collect(Collectors.toSet());
  }
  return null;
}
origin: tec.uom/uom-se

@Override
 public Set<? extends Unit<?>> getUnits(Dimension dimension) {
 return this.getUnits().stream().filter(unit -> dimension.equals(unit.getDimension()))
   .collect(Collectors.toSet());
 }
origin: tec.units/indriya

@Override
 public Set<? extends Unit<?>> getUnits(Dimension dimension) {
 return this.getUnits().stream().filter(unit -> dimension.equals(unit.getDimension()))
   .collect(Collectors.toSet());
 }
origin: tec.units/unit-ri

@Override
public Set<? extends Unit<?>> getUnits(Dimension dimension) {
 final Set<Unit<?>> set = new HashSet<Unit<?>>();
 for (Unit<?> unit : this.getUnits()) {
  if (dimension.equals(unit.getDimension())) {
   set.add(unit);
  }
 }
 return set;
}
origin: openhab/openhab-core

public Dimension getDimension() {
  return getUnit().getDimension();
}
origin: org.apache.sis.core/sis-utility

  /**
   * Returns the units defined in this system having the specified dimension, or an empty set if none.
   */
  @Override
  public Set<Unit<?>> getUnits(final Dimension dimension) {
    ArgumentChecks.ensureNonNull("dimension", dimension);
    final Set<Unit<?>> filtered = new HashSet<>();
    for (final Unit<?> unit : getUnits()) {
      if (dimension.equals(unit.getDimension())) {
        filtered.add(unit);
      }
    }
    return filtered;
  }
}
origin: performancecopilot/parfait

private static boolean areFunctionallyIdenticalUnits(Unit<?> left, Unit<?> right) {
  if (!left.isCompatible(right)) {
    return false;
  }
  Unit<?> divided = left.divide(right);
  if (!divided.getDimension().equals(Dimension.NONE)) {
    return false;
  }
  return divided.asType(Dimensionless.class).getConverterTo(ONE).equals(IDENTITY);
}
origin: tec.units/indriya

@Override
public Dimension getDimension() {
 Dimension dimension = QuantityDimension.NONE;
 for (int i = 0; i < this.getUnitCount(); i++) {
  Unit<?> unit = this.getUnit(i);
  if (this.elements != null && unit.getDimension() != null) {
   Dimension d = unit.getDimension().pow(this.getUnitPow(i)).root(this.getUnitRoot(i));
   dimension = dimension.multiply(d);
  }
 }
 return dimension;
}
origin: tec.uom/uom-se

@Override
public Dimension getDimension() {
 Dimension dimension = QuantityDimension.NONE;
 for (int i = 0; i < this.getUnitCount(); i++) {
  Unit<?> unit = this.getUnit(i);
  if (this.elements != null && unit.getDimension() != null) {
   Dimension d = unit.getDimension().pow(this.getUnitPow(i)).root(this.getUnitRoot(i));
   dimension = dimension.multiply(d);
  }
 }
 return dimension;
}
origin: tec.uom/uom-se

@SuppressWarnings("rawtypes")
@Override
public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException {
 if (!isCompatible(that))
  throw new IncommensurableException(this + " is not compatible with " + that);
 AbstractUnit thatAbstr = (AbstractUnit) that; // Since both units are
 // compatible they must
 // be both physics
 // units.
 DimensionalModel model = DimensionalModel.current();
 Unit thisSystemUnit = this.getSystemUnit();
 UnitConverter thisToDimension = model.getDimensionalTransform(thisSystemUnit.getDimension()).concatenate(this.getSystemConverter());
 Unit thatSystemUnit = thatAbstr.getSystemUnit();
 UnitConverter thatToDimension = model.getDimensionalTransform(thatSystemUnit.getDimension()).concatenate(thatAbstr.getSystemConverter());
 return thatToDimension.inverse().concatenate(thisToDimension);
}
origin: tec.units/indriya

@SuppressWarnings("rawtypes")
@Override
public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException {
 if (!isCompatible(that))
  throw new IncommensurableException(this + " is not compatible with " + that);
 AbstractUnit thatAbstr = (AbstractUnit) that; // Since both units are
 // compatible they must
 // be both physics
 // units.
 DimensionalModel model = DimensionalModel.current();
 Unit thisSystemUnit = this.getSystemUnit();
 UnitConverter thisToDimension = model.getDimensionalTransform(thisSystemUnit.getDimension()).concatenate(this.getSystemConverter());
 Unit thatSystemUnit = thatAbstr.getSystemUnit();
 UnitConverter thatToDimension = model.getDimensionalTransform(thatSystemUnit.getDimension()).concatenate(thatAbstr.getSystemConverter());
 return thatToDimension.inverse().concatenate(thisToDimension);
}
javax.measureUnitgetDimension

Popular methods of Unit

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

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • findViewById (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ImageIO (javax.imageio)
  • Reference (javax.naming)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
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