congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IConstant
Code IndexAdd Tabnine to your IDE (free)

How to use
IConstant
in
jscl.math.function

Best Java code snippets using jscl.math.function.IConstant (Showing top 14 results out of 315)

origin: org.solovyev.android/calculatorpp-core

public Builder(@Nonnull IConstant iConstant) {
  this.name = iConstant.getName();
  this.value = iConstant.getValue();
  this.system = iConstant.isSystem();
  this.description = iConstant.getDescription();
  if (iConstant.isIdDefined()) {
    this.id = iConstant.getId();
  }
}
origin: org.solovyev/jscl

@Nonnull
public static String toString(@Nonnull IConstant constant) {
  final Double doubleValue = constant.getDoubleValue();
  if (doubleValue == null) {
    final String stringValue = constant.getValue();
    if (!Strings.isEmpty(stringValue)) {
      return constant.getName() + " = " + stringValue;
    } else {
      return constant.getName();
    }
  } else {
    return constant.getName() + " = " + doubleValue;
  }
}
origin: org.solovyev/jscl

@Override
public void copy(@Nonnull MathEntity that) {
  this.constant.copy(that);
  if (that instanceof IConstant) {
    this.description = ((IConstant) that).getDescription();
    this.value = ((IConstant) that).getValue();
  }
  if (that instanceof ExtendedConstant) {
    this.javaString = ((ExtendedConstant) that).javaString;
  }
}
origin: org.solovyev/jscl

  @Override
  public boolean apply(@Nullable IConstant constant) {
    if (constant != null) {
      if (localValue.equals(constant.getDoubleValue())) {
        if (!constant.getName().equals(Constants.PI_INV.getName())) {
          if (!constant.getName().equals(Constants.PI.getName()) || JsclMathEngine.getInstance().getAngleUnits() == AngleUnit.rad) {
            return true;
          }
        }
      }
    }
    return false;
  }
});
origin: org.solovyev.android/calculatorpp-core

final IConstant var = Locator.getInstance().getEngine().getVarsRegistry().get(varName);
if (var != null) {
  if (!var.isDefined()) {
    undefinedVars.add(var);
    result.append(varName);
    offset = varName.length();
  } else {
    final String value = var.getValue();
    assert value != null;
    if (var.getDoubleValue() != null) {
origin: org.solovyev.android/calculatorpp-core

@Override
public String getDescription(@Nonnull String mathEntityName) {
  final IConstant var = get(mathEntityName);
  if (var != null && !var.isSystem()) {
    return var.getDescription();
  } else {
    return super.getDescription(mathEntityName);
  }
}
origin: org.solovyev.android/calculatorpp-core

@Nonnull
public static Set<Constant> getNotSystemConstants(@Nonnull Generic expression) {
  final Set<Constant> notSystemConstants = new HashSet<Constant>();
  for (Constant constant : expression.getConstants()) {
    IConstant var = Locator.getInstance().getEngine().getVarsRegistry().get(constant.getName());
    if (var != null && !var.isSystem() && !var.isDefined()) {
      notSystemConstants.add(constant);
    }
  }
  return notSystemConstants;
}
origin: org.solovyev.android/calculatorpp-core

if (!newConstant.getName().equals(CalculatorVarsRegistry.ANS)) {
  evaluate();
Locator.getInstance().getKeyboard().buttonPressed(constant.getName());
break;
origin: org.solovyev.android/calculatorpp-core

  @Override
  public boolean isInCategory(@Nonnull IConstant var) {
    return var.isSystem();
  }
},
origin: org.solovyev/jscl

public String toJava() {
  final IConstant constantFromRegistry = JsclMathEngine.getInstance().getConstantsRegistry().get(getName());
  if (constantFromRegistry != null) {
    return constantFromRegistry.toJava();
  }
  final StringBuilder result = new StringBuilder();
  result.append(name);
  if (prime != 0) {
    if (prime <= PRIME_CHARS) result.append(underscores(prime));
    else result.append("_").append(prime);
  }
  for (Generic subscript : subscripts) {
    result.append("[").append(subscript.integerValue().intValue()).append("]");
  }
  return result.toString();
}
origin: org.solovyev/jscl

if (piInv != null && value.equals(piInv.getDoubleValue())) {
  constant = piInv;
return constant.getName();
origin: org.solovyev.android/calculatorpp-core

  @Override
  public boolean isInCategory(@Nonnull IConstant var) {
    return !var.isSystem();
  }
};
origin: org.solovyev.android/calculatorpp-core

public void copy(@Nonnull MathEntity o) {
  if (o instanceof IConstant) {
    final IConstant that = ((IConstant) o);
    this.name = that.getName();
    this.value = that.getValue();
    this.description = that.getDescription();
    this.system = that.isSystem();
    if (that.isIdDefined()) {
      this.id = that.getId();
    }
  } else {
    throw new IllegalArgumentException("Trying to make a copy of unsupported type: " + o.getClass());
  }
}
origin: org.solovyev/jscl

public NumericWrapper(@Nonnull Constant constant) {
  final IConstant constantFromRegistry = JsclMathEngine.getInstance().getConstantsRegistry().get(constant.getName());
  if (constantFromRegistry != null) {
    if (constantFromRegistry.getName().equals(Constants.I.getName())) {
      content = Complex.I;
    } else {
      if (constantFromRegistry.getValue() != null) {
        final Double value = constantFromRegistry.getDoubleValue();
        if (value == null) {
          throw new ArithmeticException("Constant " + constant.getName() + " has invalid definition: " + constantFromRegistry.getValue());
        } else {
          content = Real.valueOf(value);
        }
      } else {
        throw new ArithmeticException("Could not create numeric wrapper: constant in registry doesn't have specified value: " + constant.getName());
      }
    }
  } else {
    throw new ArithmeticException("Could not create numeric wrapper: constant is not registered in constants registry: " + constant.getName());
  }
}
jscl.math.functionIConstant

Javadoc

User: serso Date: 11/10/11 Time: 6:01 PM

Most used methods

  • getDescription
  • getDoubleValue
  • getName
  • getValue
  • getId
  • isDefined
  • isIdDefined
  • isSystem
  • toJava

Popular in Java

  • Start an intent from android
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now