Package org.overturetool.vdmj.values

Examples of org.overturetool.vdmj.values.Value


  public static ValueInfo digForVariable(List<String> varName,
      NameValuePairList list) throws RemoteSimulationException,
      ValueException
  {
    Value value = null;
    if (list.size() > 0)
    {
      String namePart = varName.get(0);
      for (NameValuePair p : list)
      {
View Full Code Here


  public static ValueInfo digForVariable(List<String> varName,
      List<ValueInfo> list) throws RemoteSimulationException,
      ValueException
  {

    Value value = null;
    if (list.size() >= 1)
    {
      String namePart = varName.get(0);
      for (ValueInfo p : list)
      {
View Full Code Here

  }

  public static ValueInfo createValue(LexNameToken name,
      ClassDefinition classDef, Value value, CPUValue cpu)
  {
    Value val = value.deref();
    if (val instanceof SeqValue)
    {
      return new SeqValueInfo(name, classDef, (SeqValue) val, cpu);
    }
    return new ValueInfo(name, classDef, value, cpu);
View Full Code Here

  protected boolean setScalarValue(ValueInfo val, CoSimType inputType,
      String p, String name) throws RemoteSimulationException
  {
    if (val != null)
    {
      Value newval = null;

      if (inputType == CoSimType.Auto)
      {
        inputType = CoSimType.NumericValue;
        if (val.value.deref() instanceof BooleanValue)
View Full Code Here

    if (index + 1 > val.value.values.size())
    {
      return null;
    } else
    {
      Value valToInspect = val.value.values.get(index).deref();

      if (valToInspect instanceof SeqValue)
      {
        SeqValueInfo valToInspectSeq = (SeqValueInfo) VDMClassHelper.createValue(val.name, val.classDef, (SeqValue) valToInspect, val.cpu);
        return findNestedSeq(valToInspectSeq, indexes.subList(1, indexes.size()));
View Full Code Here

  private void evalEvent(String event) throws RemoteSimulationException
  {
    boolean evaluated = false;
    if (links.getEvents().keySet().contains(event))
    {
      Value val = getValue(event).value;
      if (val.deref() instanceof OperationValue)
      {
        OperationValue eventOp = (OperationValue) val;
        if (eventOp.paramPatterns.size() == 0)
        {
          try
View Full Code Here

    NameValuePairList list = SystemDefinition.getSystemMembers();
    if (list != null && links.getLinks().containsKey(name))
    {
      List<String> varName = links.getQualifiedName(name);

      Value value = VDMClassHelper.digForVariable(varName.subList(1, varName.size()), list).value;

      if (value.deref() instanceof UndefinedValue)
      {
        throw new RemoteSimulationException("Value: " + name
            + " not initialized");
      }
View Full Code Here

      }

      for (String name : logVariables)
      {
        String[] names = name.split("\\.");
        Value v = getRawValue(Arrays.asList(names), null);
        if (v == null)
        {
          throw new RemoteSimulationException("Could not find variable: "
              + name + " logging is skipped.");
        }
View Full Code Here

  public List<Double> getParameter(String name)
      throws RemoteSimulationException
  {
    try
    {
      Value value = getValue(name).value;

      List<Double> result = VDMClassHelper.getDoubleListFromValue(value);
      if (result != null)
      {
        return result;
View Full Code Here

  }

  public List<Integer> getParameterSize(String name)
      throws RemoteSimulationException
  {
    Value value = getValue(name).value;
    return VDMClassHelper.getValueDimensions(value);

  }
View Full Code Here

TOP

Related Classes of org.overturetool.vdmj.values.Value

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.