UCalc
jhplot

Class UCalc



  • public class UCalcextends Object
    Calculations using different measurement and physics unit systems.
    • Constructor Detail

      • UCalc

        public UCalc()
        Initialaze calculations with units.
    • Method Detail

      • eval

        public String eval(String havestr,          String wantstr)
        Performs the computation with units.
        Parameters:
        havestr - expression specifying the value to be converted.
        toString - string specifying unit of the desired result: expression, function name, unit list name, or unit list.
        Returns:
        answer as a string. If "error", then there was an error
      • getValue

        public double getValue()
        Returns answer as double.
        Returns:
        anser as double value
      • getUnit

        public String getUnit()
        Returns expected unit.
        Returns:
        expected unit.
      • showSource

        public void showSource()
        Show source.
      • showConformable

        public void showConformable()
        Shows units, functions, and aliases conformable to given Value. (Originally part of 'tryallunits'.)
      • search

        public void search()
        Shows units and functions with names containing the current unit. (Originally part of 'tryallunits'.)
      • search

        public void search(String name)
        Shows units and functions with names containing a given substring. (Originally part of 'tryallunits'.)
        Parameters:
        name - the name of the unit.
      • showDef

        public String showDef(String name)
        If the argument is the name of a function or unit list, returns its definition. Otherwise returns null.
        Parameters:
        name - the name.
        Returns:
        definition or null.
      • help

        public void help()
        Show help topics in a window.

SCaVis 2.1 © jWork.ORG