Package org.nlogo.nvm

Examples of org.nlogo.nvm.ArgumentTypeException


      StringBuilder buf = new StringBuilder();
      buf.append(string.substring(0, index));
      buf.append(string.substring(index + 1));
      return buf.toString();
    } else {
      throw new ArgumentTypeException
          (context, this, 1, Syntax.ListType() | Syntax.StringType(), obj);
    }
  }
View Full Code Here


      if (string.length() == 0) {
        throw new EngineException(context, this, I18N.errorsJ().get("org.nlogo.prim.etc.$common.emptyString"));
      }
      return string.substring(0, 1);
    } else {
      throw new ArgumentTypeException
          (context, this, 0, Syntax.ListType() | Syntax.StringType(), obj);
    }
  }
View Full Code Here

        return Boolean.FALSE;
      } else {
        return Double.valueOf(i);
      }
    } else {
      throw new ArgumentTypeException
          (context, this, 1, Syntax.ListType() | Syntax.StringType(), obj);
    }
  }
View Full Code Here

      return list.isEmpty() ? Boolean.TRUE : Boolean.FALSE;
    } else if (obj instanceof String) {
      String string = (String) obj;
      return (string.length() == 0) ? Boolean.TRUE : Boolean.FALSE;
    } else {
      throw new ArgumentTypeException(context, this, 0, Syntax.ListType() | Syntax.StringType(), obj);
    }
  }
View Full Code Here

      if (string.length() == 0) {
        throw new EngineException(context, this, I18N.errorsJ().get("org.nlogo.prim.etc.$common.emptyString"));
      }
      return string.substring(string.length() - 1);
    } else {
      throw new ArgumentTypeException
          (context, this, 0, Syntax.ListType() | Syntax.StringType(), obj);
    }
  }
View Full Code Here

    for (int i = 0; i < args.length; i++) {
      Object elt = args[i].report(context);
      if (elt instanceof AgentSet) {
        AgentSet tempSet = (AgentSet) elt;
        if (tempSet.type() != org.nlogo.agent.Turtle.class) {
          throw new ArgumentTypeException
              (context, this, i, Syntax.TurtleType() | Syntax.TurtlesetType(), elt);
        }
        for (AgentSet.Iterator iter = tempSet.iterator();
             iter.hasNext();) {
          resultSet.add((Turtle) iter.next());
        }
      } else if (elt instanceof LogoList) {
        descendList(context, (LogoList) elt, resultSet);
      } else if (elt instanceof Turtle) {
        resultSet.add((Turtle) elt);
      } else if (elt != org.nlogo.api.Nobody$.MODULE$) {
        throw new ArgumentTypeException
            (context, this, i, Syntax.TurtleType() | Syntax.TurtlesetType(), elt);
      }
    }
    return new org.nlogo.agent.ArrayAgentSet(
        org.nlogo.agent.Turtle.class,
View Full Code Here

    if (obj instanceof LogoList) {
      return report_2(context, (LogoList) obj);
    } else if (obj instanceof String) {
      return report_3(context, (String) obj);
    }
    throw new ArgumentTypeException
        (context, this, 0, Syntax.ListType() | Syntax.StringType(), obj);
  }
View Full Code Here

    if (obj instanceof LogoList) {
      return ((LogoList) obj).size();
    } else if (obj instanceof String) {
      return ((String) obj).length();
    }
    throw new ArgumentTypeException
        (context, this, 0, Syntax.ListType() | Syntax.StringType(), obj);
  }
View Full Code Here

TOP

Related Classes of org.nlogo.nvm.ArgumentTypeException

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.