Package ca.nengo.config

Examples of ca.nengo.config.Configuration


  }
 
  //TODO: test remaining fields
 
  public void testConstruction() throws StructuralException {
    Configuration template = MockConfigurable.getConstructionTemplate();
    ((SingleValuedProperty) template.getProperty("immutableField")).setValue("custom");
    MockConfigurable c = new MockConfigurable(template);
    assertEquals("custom", c.getImmutableField());
  }
View Full Code Here


  public Object getChild(Object parent, int index) {
    Object result = null;

    try {
      if (parent instanceof Value) {
        Configuration c = ((Value) parent).getConfiguration();
        if (c != null) {
          List<String> propertyNames = c.getPropertyNames();
          Collections.sort(propertyNames);
          result = c.getProperty(propertyNames.get(index));
        }
      } else if (parent instanceof ListProperty) {
        ListProperty p = (ListProperty) parent;
        Object o = p.getValue(index);
        result = new Value(index, o);
View Full Code Here

   */
  public int getChildCount(Object parent) {
    int result = 0;

    if (parent instanceof Value) {
      Configuration configuration = ((Value) parent).getConfiguration();
      if (configuration != null) {
                result = configuration.getPropertyNames().size();
            }
    } else if (parent instanceof SingleValuedProperty) {
      result = 1;
    } else if (parent instanceof ListProperty) {
      result = ((ListProperty) parent).getNumValues();
View Full Code Here

  public int getIndexOfChild(Object parent, Object child) {
    int index = -1;

    try {
      if (child instanceof Property) {
        Configuration c = ((Value) parent).getConfiguration();
        Property p = (Property) child;
        List<String> propertyNames = c.getPropertyNames();
        Collections.sort(propertyNames);
        index = propertyNames.indexOf(p.getName());
      } else if (parent instanceof SingleValuedProperty) {
        SingleValuedProperty p = (SingleValuedProperty) parent;
        Value v = (Value) child;
View Full Code Here

TOP

Related Classes of ca.nengo.config.Configuration

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.