Package anvil.core

Examples of anvil.core.Any.toObject()


      case 2:
        {
          Any param = parameters[0];
          String[] attributes = AnyUtils.toStringArray(parameters[1]);
          if (param instanceof AnyName) {
            return new AnyAttributes(dirctx.getAttributes((Name)param.toObject(), attributes));
          } else {
            return new AnyAttributes(dirctx.getAttributes(parameters[0].toString(), attributes));
          }
        }
View Full Code Here


      case 1:
        {
          Any param = parameters[0];
          if (param instanceof AnyName) {
            return new AnyAttributes(dirctx.getAttributes((Name)param.toObject()));
          } else {
            return new AnyAttributes(dirctx.getAttributes(param.toString()));
          }
        }
       
View Full Code Here

    int modop = DirContext.REPLACE_ATTRIBUTE;
   
    for(; i<n; i++) {
      param = parameters[i];
      if (param instanceof AnyName) {
        name = (Name)param.toObject();
      } else if (param instanceof AnyAttributes) {
        attributes = (Attributes)param.toObject();
      } else if (param.isString()) {
        sname = param.toString();
      } else if (param.isInt()) {
View Full Code Here

    for(; i<n; i++) {
      param = parameters[i];
      if (param instanceof AnyName) {
        name = (Name)param.toObject();
      } else if (param instanceof AnyAttributes) {
        attributes = (Attributes)param.toObject();
      } else if (param.isString()) {
        sname = param.toString();
      } else if (param.isInt()) {
        modop = param.toInt();
      } else if (param.isMap()) {
View Full Code Here

    }
    try {
      if (parameters.length == 1) {
        Any param = parameters[0];
        if (param instanceof AnyName) {
          _name.addAll((Name)param.toObject());
        } else {
          _name.add(param.toString());
        }
      } else {
        int index = parameters[0].toInt();
View Full Code Here

      } else {
        int index = parameters[0].toInt();
        if (index>=0 && index<=_name.size()) {
          Any param = parameters[1];
          if (param instanceof AnyName) {
            _name.addAll(index, (Name)param.toObject());
          } else {
            _name.add(index, param.toString());
          }
        }
      }
View Full Code Here

    try {
      Any param = parameters[0];
      if (!(param instanceof AnyName)) {
        throw context.BadParameter("Name expected");
      }
      return Any.create(_name.startsWith((Name)param.toObject()));
    } catch (Exception e) {
      throw context.exception(e);
    }
  }
View Full Code Here

    try {
      Any param = parameters[0];
      if (!(param instanceof AnyName)) {
        throw context.BadParameter("Name expected");
      }
      return Any.create(_name.endsWith((Name)param.toObject()));
    } catch (Exception e) {
      throw context.exception(e);
    }
  }
View Full Code Here

    if (parameters.length<2) {
      throw parametersMissing(context, "insert");
    }
    Any value = parameters[1];
    if (value instanceof AnySynapse) {
      _dim.insert(parameters[0].toInt(), (Synapse)value.toObject());
      return this;
    } else {
      throw context.BadParameter("Dimension may only contain anvil.brain.Synapse instances");
    }
  }
View Full Code Here

    if (parameters.length<1) {
      throw parametersMissing(context, "add");
    }
    Any value = parameters[0];
    if (value instanceof AnySynapse) {
      _dim.add((Synapse)value.toObject());
      return this;
    } else {
      throw context.BadParameter("Dimension may only contain anvil.brain.Synapse instances");
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.