Package ca.nengo.model

Examples of ca.nengo.model.StructuralException


    myName = name;
   
    try {
      myUnits = probeable.getHistory(state).getUnits()[dimension];
    } catch (SimulationException e) {
      throw new StructuralException("Problem getting pre-simulation history in order to find state variable units", e);
    }   
  }
View Full Code Here


   */
  public Property getProperty(String name) throws StructuralException {
    if (myProperties.containsKey(name)) {
      return myProperties.get(name);
    } else {
      throw new StructuralException("The property " + name + " is unknown");
    }
  }
View Full Code Here

    Object configurable = getConfiguration().getConfigurable();
   
    try {
      mySetter.invoke(configurable, new Object[]{value});
    } catch (InvocationTargetException e) {
      throw new StructuralException("Can't set " + getName() + ": " + e.getCause().getMessage(), e);
    } catch (Exception e) {
      throw new StructuralException("Can't set " + getName(), e);
    }
  }
View Full Code Here

        getList(myTarget, myListGetter).set(index, value);
      } else {
        if (isMutable()) {
          throw new RuntimeException("The property is marked as mutable but there are no methods for changing -- this appears to be a bug");
        } else {
          throw new StructuralException("This property is immutable");
        }
      }
    } catch (IllegalArgumentException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
View Full Code Here

        System.arraycopy(array, 0, newArray, 0, Array.getLength(array));
        Array.set(newArray, Array.getLength(array), value);
        myArraySetter.invoke(myTarget, new Object[]{newArray});
      } else {
        if (isFixedCardinality()) {
          throw new StructuralException("This property has fixed cardinality");
        } else {
          throw new RuntimeException("The property is not marked as having fixed cardinality " +
              "but there are no methods for adding a value -- this appears to be a bug");
        }
      }
View Full Code Here

        Array.set(newArray, index, value);
        System.arraycopy(array, index, newArray, index+1, Array.getLength(array)-index);
        myArraySetter.invoke(myTarget, new Object[]{newArray});
      } else {
        if (isFixedCardinality()) {
          throw new StructuralException("This property has fixed cardinality");
        } else {
          throw new RuntimeException("The property is not marked as having fixed cardinality " +
              "but there are no methods for inserting a value -- this appears to be a bug");
        }
      }
View Full Code Here

        System.arraycopy(array, 0, newArray, 0, index);
        System.arraycopy(array, index+1, newArray, index, Array.getLength(newArray) - index);
        myArraySetter.invoke(myTarget, new Object[]{newArray});
      } else {
        if (isFixedCardinality()) {
          throw new StructuralException("This property has fixed cardinality");
        } else {
          throw new RuntimeException("The property is not marked as having fixed cardinality " +
              "but there are no methods for removing a value -- this appears to be a bug");
        }
      }
View Full Code Here

    myValue = value;
  }

  private void checkClass(Object value) throws StructuralException {
    if (!getType().isAssignableFrom(value.getClass())) {
      throw new StructuralException("Value must be of type " + getType()
          + " (was " + value.getClass().getName() + ")");
    }
  }
View Full Code Here

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

  public Termination addTermination(String name, float[][] transform)
      throws StructuralException {
    for (Termination t : getTerminations()) {
      if (t.getName().equals(name))
        throw new StructuralException("This node already contains a termination named " + name);
    }

    PassthroughTermination result = new PassthroughTermination(this, name, transform);
    myTerminations.put(name, result);
    return result;
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.