Package anvil.brain

Examples of anvil.brain.Synapse


  }
 

  public Any getReference(Context context, Any index)
  {
    Synapse syn = _dim.get(index.toInt());
    return (syn != null) ? new AnySynapse(syn) : UNDEFINED;
  }
View Full Code Here


 
  public boolean deleteReference(Context context, Any index)
  {
    if (index instanceof AnySynapse) {
      Synapse synapse = (Synapse)index.toObject();
      _dim.remove(synapse);
      return true;
    } else {
      return _dim.remove(index.toInt()) != null;
    }
View Full Code Here

    if (parameters.length<1) {
      throw parametersMissing(context, "remove");
    }
    Any index = parameters[0];
    if (index instanceof AnySynapse) {
      Synapse synapse = (Synapse)index.toObject();
      _dim.remove(synapse);
    } else {
      _dim.remove(index.toInt());
    }
    return this;
View Full Code Here

  public Any m_get(Context context, Any[] parameters)
  {
    if (parameters.length<1) {
      throw parametersMissing(context, "get");
    }
    Synapse syn = _dim.get(parameters[0].toInt());   
    return syn != null ? new AnySynapse(syn) : UNDEFINED;
 
View Full Code Here

    Any value = parameters[1];
    try {
      AnyList list = new AnyList();
      Enumeration e = _dim.elements();
      while(e.hasMoreElements()) {
        Synapse synapse = (Synapse)e.nextElement();
        Any cand = synapse.checkVariable(name);
        if (cand.isDefined()) {
          if (cand.equals(value)) {
            list.append(new AnySynapse(synapse));
          }
        }
View Full Code Here


  public Any getReference(Context context, Any index)
  {
    try {
      Synapse syn = _brain.get(index.toLong());
      return new AnySynapse(syn);
    } catch (OperationFailedException e) {
      throw context.exception(e);
    }
  }
View Full Code Here

  {
    if (parameters.length < 1) {
      throw parametersMissing(context, "get");
    }
    try {
      Synapse syn = _brain.get(parameters[0].toLong());
      return new AnySynapse(syn);
    } catch (OperationFailedException e) {
      throw context.exception(e);
    }
  }
View Full Code Here

  {
    if (parameters.length < 2) {
      throw parametersMissing(context, "create");
    }
    try {
      Synapse syn = _brain.create(parameters[0].toString(), parameters[1].toString());
      return new AnySynapse(syn);
    } catch (OperationFailedException e) {
      throw context.exception(e);
    }
  }
View Full Code Here

TOP

Related Classes of anvil.brain.Synapse

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.