Package org.data2semantics.platform.core.data

Examples of org.data2semantics.platform.core.data.InstanceInput


   
    // Find the values (in order) for each parameter of the constructor
    for(int i=0;i<annotations.length;i++)
    {
      In ia = getAnnotation(annotations[i], In.class);
      InstanceInput ii = instance.input(ia.name());
      args[i] = ii.value();
    }
   
    // Call constructor to instantiate the module object
    Object moduleObject = null;
    try {
View Full Code Here


    for(int i=0;i<annotations.length;i++){
      for(int j=0;j<annotations[i].length;j++){
        if(annotations[i][j] instanceof In)
        {
          In ia = (In)annotations[i][j];
          InstanceInput ii = instance.input(ia.name());
          args[i] = ii.value();
        }
      }
    }
   
    // Call the factory method to instantiate the module object
View Full Code Here

      if(curInput instanceof RawInput){
       
        Map<Input, InstanceInput> nextUniverse = new LinkedHashMap<Input, InstanceInput>(universe);
        Object nextValue =  ((RawInput) curInput).value();
       
        nextUniverse.put(curInput, new InstanceInput(this, curInput, nextValue));
        instantiateInputRec(nextUniverse,  depth+1);
     
      } else
      if(curInput instanceof ReferenceInput){
       
View Full Code Here

         
            nextUniverse = new LinkedHashMap<Input, InstanceInput>(nextUniverse);
           
            if(!coupledInputs){
           
              nextUniverse.put(originInput, new InstanceInput(this, originInput, nextValue, refInstanceOutput));
             
            } else {
              for(String ciName : coupledInputsFor(originInput.name())){
               
                // we are only coupling multi inputs
                if(!(input(ciName) instanceof MultiInput))
                  throw new IllegalStateException(" can't couple non multiple inputs");
             
                MultiInput coupledMi = (MultiInput) input(ciName);
               
                if(coupledMi.inputs().size() != ((MultiInput)originInput).inputs().size())
                  throw new IllegalStateException("These multiple inputs have different length and can't be coupled");
               
                // Raw inputs can only be coupled with another reference input
                if(!(coupledMi.inputs().get(idx) instanceof ReferenceInput))
                  throw new IllegalStateException(" Reference can only be paired with another reference ");
           
                ReferenceInput ri = (ReferenceInput) coupledMi.inputs().get(idx);
                if(!(ri.reference().module().equals(curMultiRefInput.reference().module())))
                  throw new IllegalStateException(" Reference can only be paired with another reference from the same module");
           
                // We are selecting next avlue from the same module instance
                InstanceOutput refIO = curModuleInstance.output(ri.reference().name());
                nextValue = refIO.value();
                //System.out.println("Assigning "+ri.reference().module().name()+"."+ri.reference().name()+" into "+name()+"."+coupledMi.name());
                nextUniverse.put(coupledMi, new InstanceInput(this, coupledMi, nextValue, refIO));
              }
            }
           
            instantiateInputRec( nextUniverse,  depth+1);
           
         
          } else {
            // Can't handle multi valued coupled inputs 
            for(Object v : (List<Object>)nextValue){
         
              nextUniverse = new LinkedHashMap<Input, InstanceInput>(nextUniverse);
              nextUniverse.put(originInput, new InstanceInput(this, originInput, v, refInstanceOutput));
             
              instantiateInputRec( nextUniverse, depth+1);
            }
           
          }
View Full Code Here

      Map<Input, InstanceInput> nextUniverse = new LinkedHashMap<Input, InstanceInput>(universe);
   
      if( coupledInputsFor(originInput.name()) == null){
        Object nextValue =  curMultiInput.value();
       
        nextUniverse.put(originInput, new InstanceInput(this, originInput, nextValue));
        instantiateInputRec(nextUniverse,  depth+1);
       
      } else {
        for(String ciName : coupledInputsFor(originInput.name())){
         
          // we are only coupling multi inputs
          if(!(input(ciName) instanceof MultiInput))
            throw new IllegalStateException("Can't pair non multiple inputs");
         
          MultiInput mi = (MultiInput) input(ciName);
         
          // Raw inputs can only be coupled with another raw input
          if(!(mi.inputs().get(idx) instanceof RawInput))
            throw new IllegalStateException("Raw inputs can only be paired with another raw inputs ");
         
          RawInput ri = (RawInput) mi.inputs().get(idx);
         
          nextUniverse.put(mi, new InstanceInput(this, mi, ri.value()));
        }
       
        instantiateInputRec(nextUniverse,  depth+1);
      }
  }
View Full Code Here

         
         
          if(!ri.multiValue()){
         
            nextUniverse = new LinkedHashMap<Input, InstanceInput>(nextUniverse);
            nextUniverse.put(origin, new InstanceInput(this, origin, nextValue, refInstanceOutput));
           
            instantiateInputRec( nextUniverse,  depth+1);
         
          } else {
             
            for(Object v : (List<Object>)nextValue){
         
              nextUniverse = new LinkedHashMap<Input, InstanceInput>(nextUniverse);
              nextUniverse.put(origin, new InstanceInput(this, origin, v, refInstanceOutput));
             
              instantiateInputRec( nextUniverse, depth+1);
            }
           
          }
View Full Code Here

      this.moduleID=id;
      this.universe = universe;
     
      for(Input i : module().inputs()){
       
            InstanceInput ii = universe.get(i);
                ii.setInstance(this);
                this.inputs.put(ii.name(), ii);
      }
     
      for(Output original : module().outputs()){
        InstanceOutput instanceOutput = new InstanceOutput( module(), original, this);
        outputs.put(instanceOutput.name(), instanceOutput);
View Full Code Here

TOP

Related Classes of org.data2semantics.platform.core.data.InstanceInput

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.