Package ca.nengo.model

Examples of ca.nengo.model.StructuralException


   */
  public Termination getTermination(String name) throws StructuralException {
    if (myTerminations.containsKey(name)) {
      return myTerminations.get(name);
    } else {
      throw new StructuralException("Unknown termination: " + name);
    }
  }
View Full Code Here


      } else {
        throw new RuntimeException("There is no getter method for property "
            + getName() + " -- this appears to be a bug");
      }
    } catch (Exception e) {
      throw new StructuralException("Can't get value " + name, e);
    }

    return result;
  }
View Full Code Here

    } else if (myMapGetter != null) {
      Map<?,?> map = (Map<?,?>) invoke(myTarget, myMapGetter, new Object[0]);
      map.remove(name);
    } else {
      if (!isMutable()) {
        throw new StructuralException("This property is immutable");
      } else {
        throw new RuntimeException("Property is marked as mutable but there is no method for removing a value " +
            "-- this appears to be a bug");
      }
    }
View Full Code Here

      map.put(name, value);
    } else if (myUnnamedSetter != null) {
      invoke(myTarget, myUnnamedSetter, new Object[]{value});
    } else {
      if (!isMutable()) {
        throw new StructuralException("This property is immutable");
      } else {
        throw new RuntimeException("Property is marked as mutable but there is no method for setting a value " +
            "-- this appears to be a bug");
      }
    }
View Full Code Here

  public void setValue(Object value) throws StructuralException {
    if (myUnnamedSetter != null) {
      invoke(myTarget, myUnnamedSetter, new Object[]{value});
    } else {
      if (!isMutable()) {
        throw new StructuralException("This property is immutable");
      } else if (!isNamedAutomatically()) {
        throw new StructuralException("Names must be specified for values of this property");
      } else {
        throw new RuntimeException("Property is marked as mutable and automatically-named, but there is no method for setting a value " +
            " without specifying a name -- this appears to be a bug");
      }
    }
View Full Code Here

   * @throws StructuralException if the new name is invalid
   */
  public static void nameChanged(final VisiblyMutable vm, final String oldName, final String newName,
      List<VisiblyMutable.Listener> listeners) throws StructuralException {
     
    if (!isValidName(newName)) throw new StructuralException("Name '"+newName+"' must not contain '.' or ':'");
   
    VisiblyMutable.NameChangeEvent event = new VisiblyMutable.NameChangeEvent() {

      public String getNewName() {
        return newName;
      }

      public String getOldName() {
        return oldName;
      }

      public VisiblyMutable getObject() {
        return vm;
      }
     
    };
   
    try {
      fire(event, listeners);     
    } catch (RuntimeException e) {
      throw new StructuralException(e.getMessage(), e);
    }
  }
View Full Code Here

    if (name.equals(Neuron.AXON)) {
      return mySpikeOrigin;
    } else if (name.equals(CURRENT)){
      return myCurrentOrigin;
    } else {
      throw new StructuralException("Origin does not exist");
    }
  }
View Full Code Here

   */
  public Origin getOrigin(String name) throws StructuralException {
    if (ORIGIN.equals(name)) {
      return myOrigin;
    } else {
      throw new StructuralException("Unknown origin: " + name);
    }
  }
View Full Code Here

   */
  public Termination getTermination(String name) throws StructuralException {
    if (myTerminations.containsKey(name)) {
      return myTerminations.get(name);
    } else {
      throw new StructuralException("Unknown termination: " + name);
    }
  }
View Full Code Here

    public void setModulatory(boolean modulatory) {
      throw new RuntimeException("A termination on a passthrough node is never modulatory");
    }

    public void setTau(float tau) throws StructuralException {
      throw new StructuralException("A termination on a passthrough node has no dynamics");
    }
View Full Code Here

TOP

Related Classes of ca.nengo.model.StructuralException

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.