public MainPagerAdapter(@NonNull FragmentActivity fragmentActivity, ArrayList<Data1> data1,
ArrayList<Data2> data2)
{
super(fragmentActivity);
this.fragmentActivity = fragmentActivity;
this.data1 = data1;
this.data2= data2;
}
public void setData(ArrayList<Data1> data1)
{
this.data1= data1;
}
public Fragment createFragment(int position)
{
Fragment fragment = null;
if (position == 0)
{
Fragment1 f1= new Fragment1 ();
f1.setData(data1);
fragment = f1;
}
else if (position == 1)
{
Fragment2 f2 = new Fragment2 ();
f2.setData(data2);
fragment = f2;
}
return fragment;
}
neuralnet[neuralnet.size() - 1][neuron].weight[synaps] -= (iter_delta[iter_delta.size() - 1][neuron][synaps] = delta_weight(act_status[act_status.size() - 1][neuron], act_status[act_status.size() - 2][synaps], iter_delta[iter_delta.size() - 1][neuron][synaps], errors[neuron]));
}
public class Object
{
public interface IObject
{
void doSmth();
}
public static IObject build(String param)
{
IObject obj;
switch (param)
{
case "s":
obj = new IObject()
{
@Override
public void doSmth()
{
//doing
}
};
break;
case "f":
obj = new IObject()
{
@Override
public void doSmth()
{
//doing
}
};
break;
default:
obj = new IObject()
{
@Override
public void doSmth()
{
//doing
}
};
break;
}
return obj;
}
}
Спасибо!