Skip to content

extract the Dimension class from a given unit or Quantity #438

@3Fish

Description

@3Fish

Hi,

I use Idriya in the context of a compiler, where I need to define the actuall Dimension type.
Therefore I need to somehow get the actual Dimension class for a parsed Unit or Quantity.
eg.

SimpleUnitFormat format = SimpleUnitFormat.getInstance();
Unit<?> unit = format.parse("V");
Class<?> clazz = unit.getDimensionClass(); 
assert(clazz.equals(ElectricPotential.class));

Is there currently a way to do this? I have not found anything. If not, I would propose a change that preserves this information and allows the user to retrieve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions