📄 simplefactory.java
字号:
/* * SimpleFactory.java * * Created on 7 luglio 2004, 20.15 */package org.joone.dte.factory;import org.joone.dte.TaskFactory;import org.joone.net.NeuralNet;import java.util.List;import java.util.ArrayList;/** Very simple implementation of the TaskFactory interface. * It is not many useful, but can be used as starting point * to build more complex TaskFactory implementations. * * @author P.Marrone */public class SimpleFactory implements TaskFactory { protected ArrayList list; protected int currTask; /** Creates a new instance of SimpleFactory */ public SimpleFactory() { } /** * Getter for the Tasks property. * @return a List of NeuralNet objects * @deprecated Use instead getNextTask() */ public List getTasks() { return list; } /** * Setter for the Tasks property. * @param tasks Accepts as input a List of NeuralNet objects */ public void setTasks(java.util.List tasks) { list = (ArrayList)tasks; } public void initialize() { currTask = 0; } public NeuralNet getNextTask() { if ((list == null) || (currTask >= getTotTasks())) return null; NeuralNet task = (NeuralNet)list.get(currTask++); return task; } public int getTotTasks() { if (list != null) return list.size(); else return 0; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -