package org.jlayer.app; 

import javax.annotation.processing.Generated;
import org.jlayer.model.*;
import org.jlayer.util.*;

@Generated("org.jlayer.Processor") 
public class Layer_Input_ extends ALayer_Input_ implements ILayer_Input_ {

   // class Layer_Input_.D1
   static public class D1 extends ALayer_Input_.D1 implements ILayer_Input_.D1 {
      // constructors 
      public D1(ILayer_Input_.D1 layerD1){ 
         super(layerD1); 
         // create adapters 
         y = new LayerAdapter.D1<Input,MyUtils.Signal>(){
            public int length() { return D1.this.length(); } 
            public MyUtils.Signal get(int x1) { return D1.this.get(x1).y; }
            public void set(int x1, MyUtils.Signal val){ D1.this.get(x1).y = val; }
            public Input getUnit(int x1) { return D1.this.getUnit(x1); }
            public void setUnit(int x1, Input unit){ D1.this.setUnit(x1, unit); }
         };
      }
      public D1(Input[] array){ 
         super(array); 
         // create adapters 
         y = new LayerAdapter.D1<Input,MyUtils.Signal>(){
            public int length() { return D1.this.length(); } 
            public MyUtils.Signal get(int x1) { return D1.this.get(x1).y; }
            public void set(int x1, MyUtils.Signal val){ D1.this.get(x1).y = val; }
            public Input getUnit(int x1) { return D1.this.getUnit(x1); }
            public void setUnit(int x1, Input unit){ D1.this.setUnit(x1, unit); }
         };
      }
      // method items 
      public void setInput(Layer.D1<?,Double> input){
         XIterator.D1<Input> iterator = this.xIterator(); 
         while( iterator.hasNext() ){
            int _x1 = iterator.getX1();
            Input _unit = iterator.next();
            _unit.setInput(input.get(_x1));
         }
      }
   }

   // class Layer_Input_.D2
   static public class D2 extends ALayer_Input_.D2 implements ILayer_Input_.D2 {
      // constructors 
      public D2(ILayer_Input_.D2 layerD2){ 
         super(layerD2); 
         // create adapters 
         y = new LayerAdapter.D2<Input,MyUtils.Signal>(){
            public int length() { return D2.this.length(); }
            public int length(int x1) { return D2.this.length(x1); }
            public MyUtils.Signal get(int x1, int x2) { return D2.this.get(x1, x2).y; }
            public void set(int x1, int x2, MyUtils.Signal val){ D2.this.get(x1, x2).y = val; }
            public Input getUnit(int x1, int x2) { return D2.this.getUnit(x1, x2); }
            public void setUnit(int x1, int x2, Input unit){ D2.this.setUnit(x1, x2, unit); }
         };
      }
      public D2(Input[][] array){ 
         super(array); 
         // create adapters 
         y = new LayerAdapter.D2<Input,MyUtils.Signal>(){
            public int length() { return D2.this.length(); }
            public int length(int x1) { return D2.this.length(x1); }
            public MyUtils.Signal get(int x1, int x2) { return D2.this.get(x1, x2).y; }
            public void set(int x1, int x2, MyUtils.Signal val){ D2.this.get(x1, x2).y = val; }
            public Input getUnit(int x1, int x2) { return D2.this.getUnit(x1, x2); }
            public void setUnit(int x1, int x2, Input unit){ D2.this.setUnit(x1, x2, unit); }
         };
      }
      // method items 
      public void setInput(Layer.D2<?,Double> input){
         XIterator.D2<Input> iterator = this.xIterator(); 
         while( iterator.hasNext() ){
            int _x2 = iterator.getX2();
            int _x1 = iterator.getX1();
            Input _unit = iterator.next();
            _unit.setInput(input.get(_x1,_x2));
         }
      }
   }

   // class Layer_Input_.D3
   static public class D3 extends ALayer_Input_.D3 implements ILayer_Input_.D3 {
      // constructors 
      public D3(ILayer_Input_.D3 layerD3){ 
         super(layerD3); 
         // create adapters 
         y = new LayerAdapter.D3<Input,MyUtils.Signal>(){
            public int length() { return D3.this.length(); }
            public int length(int x1) { return D3.this.length(x1); }
            public int length(int x1, int x2) { return D3.this.length(x1, x2); }
            public MyUtils.Signal get(int x1, int x2, int x3) { return D3.this.get(x1, x2, x3).y; }
            public void set(int x1, int x2, int x3, MyUtils.Signal val){ D3.this.get(x1, x2, x3).y = val; }
            public Input getUnit(int x1, int x2, int x3) { return D3.this.getUnit(x1, x2, x3); }
            public void setUnit(int x1, int x2, int x3, Input unit){ D3.this.setUnit(x1, x2, x3, unit); }
         };
      }
      public D3(Input[][][] array){ 
         super(array); 
         // create adapters 
         y = new LayerAdapter.D3<Input,MyUtils.Signal>(){
            public int length() { return D3.this.length(); }
            public int length(int x1) { return D3.this.length(x1); }
            public int length(int x1, int x2) { return D3.this.length(x1, x2); }
            public MyUtils.Signal get(int x1, int x2, int x3) { return D3.this.get(x1, x2, x3).y; }
            public void set(int x1, int x2, int x3, MyUtils.Signal val){ D3.this.get(x1, x2, x3).y = val; }
            public Input getUnit(int x1, int x2, int x3) { return D3.this.getUnit(x1, x2, x3); }
            public void setUnit(int x1, int x2, int x3, Input unit){ D3.this.setUnit(x1, x2, x3, unit); }
         };
      }
      // method items 
      public void setInput(Layer.D3<?,Double> input){
         XIterator.D3<Input> iterator = this.xIterator(); 
         while( iterator.hasNext() ){
            int _x3 = iterator.getX3();
            int _x2 = iterator.getX2();
            int _x1 = iterator.getX1();
            Input _unit = iterator.next();
            _unit.setInput(input.get(_x1,_x2,_x3));
         }
      }
   }

// class Layer_Input_

   // constructors 
   public Layer_Input_(Input[] array){ 
      super(array); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }
   public Layer_Input_(Input[][] array){ 
      super(array); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }
   public Layer_Input_(Input[][][] array){ 
      super(array); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }

   public Layer_Input_(ILayer_Input_ layer){ 
      super(layer); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }
   public Layer_Input_(ILayer_Input_.D1 layer){ 
      super(layer); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }
   public Layer_Input_(ILayer_Input_.D2 layer){ 
      super(layer); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }
   public Layer_Input_(ILayer_Input_.D3 layer){ 
      super(layer); 
      // create adapters 
      y = new LayerAdapter<Input,MyUtils.Signal>(){
         public int dims() { return Layer_Input_.this.dims(); } 
         public int length() { return Layer_Input_.this.length(); } 
         public int length(int... ix) { return Layer_Input_.this.length(ix); } 
         public MyUtils.Signal get(int... ix) { return Layer_Input_.this.get(ix).y; }
         public void set(int[] ix, MyUtils.Signal val){ Layer_Input_.this.get(ix).y = val; }
         public void set(int x1, MyUtils.Signal val){ Layer_Input_.this.get(x1).y = val; }
         public void set(int x1, int x2, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2).y = val; }
         public void set(int x1, int x2, int x3, MyUtils.Signal val){ Layer_Input_.this.get(x1, x2, x3).y = val; }
         public Input getUnit(int... ix) { return Layer_Input_.this.getUnit(ix); }
         public void setUnit(int[] ix, Input unit){ Layer_Input_.this.setUnit(ix, unit); }
         public void setUnit(int x1, Input unit){ Layer_Input_.this.setUnit(x1, unit); }
         public void setUnit(int x1, int x2, Input unit){ Layer_Input_.this.setUnit(x1, x2, unit); }
         public void setUnit(int x1, int x2, int x3, Input unit){ Layer_Input_.this.setUnit(x1, x2, x3, unit); }
      };
   }

   // getD1(), getD2(), getD3() 
   public D1 getD1() {
      if (this.dimensionality != 1) return null;
      return new D1(layerD1.getBase());
   }
   public D2 getD2() {
      if (this.dimensionality != 2) return null;
      return new D2(layerD2.getBase());
   }
   public D3 getD3() {
      if (this.dimensionality != 3) return null;
      return new D3(layerD3.getBase());
   }

   // further method items 
   public void setInput(Layer<?,Double> input){
      if (this.dims() != input.dims()) throw new JLayerException("Invocation of method layer setInput(): input.dims() does not fit");
      switch(this.dims()) {
         case 1:
            D1 _layerD1_ = new D1(layerD1.getBase());
            _layerD1_.setInput(input.getD1()); break;
         case 2:
            D2 _layerD2_ = new D2(layerD2.getBase());
            _layerD2_.setInput(input.getD2()); break;
         case 3:
            D3 _layerD3_ = new D3(layerD3.getBase());
            _layerD3_.setInput(input.getD3()); break;
         default: throw new JLayerException();
      }
   }

} // end of class Layer_Input_
