@Test public void testAddTask() { Application<Task, Dependency> application = new Application<Task, Dependency>(); String line = " TASK test0_0 TYPE 0"; String suffix = "_0"; double period = 0.0; ReaderTGFF reader = new ReaderTGFF(); reader.addTask(line, suffix, period, application); String id = "test0_0_0"; Assert.assertEquals(1, application.getVertexCount()); Assert.assertEquals(id, application.iterator().next().getId()); }
protected void addTask(String line, String suffix, double period, Application<Task, Dependency> application) { String[] entries = line.trim().split(SEPARATOR); assert entries.length >= 4 : "tgff-file \"" + TASK + "\": wrong number of entries"; String id = entries[1] + suffix; String type = entries[3]; Task task = new Task(id); task.setAttribute(PERIOD, period); task.setAttribute(TGFF_TYPE, type); if (tgffTypeMap.containsKey(type)) { List<Task> taskList = tgffTypeMap.get(type); taskList.add(task); } else { LinkedList<Task> taskList = new LinkedList<Task>(); taskList.add(task); tgffTypeMap.put(type, taskList); } application.addVertex(task); }
ReaderTGFF { protected void addTask(String line, String suffix, double period, Application<Task, Dependency> application) { String[] entries = line.trim().split(SEPARATOR); assert entries.length >= 4 : "tgff-file \"" + TASK + "\": wrong number of entries"; String id = entries[1] + suffix; String type = entries[3]; Task task = new Task(id); task.setAttribute(PERIOD, period); task.setAttribute(TGFF_TYPE, type); if (tgffTypeMap.containsKey(type)) { List<Task> taskList = tgffTypeMap.get(type); taskList.add(task); } else { LinkedList<Task> taskList = new LinkedList<Task>(); taskList.add(task); tgffTypeMap.put(type, taskList); } application.addVertex(task); } }
ReaderTGFF { protected void addTask(String line, String suffix, double period, Application<Task, Dependency> application) { String[] entries = line.trim().split(SEPARATOR); assert entries.length >= 4 : "tgff-file \"" + TASK + "\": wrong number of entries"; String id = entries[1] + suffix; String type = entries[3]; Task task = new Task(id); task.setAttribute(PERIOD, period); task.setAttribute(TGFF_TYPE, type); if (tgffTypeMap.containsKey(type)) { List<Task> taskList = tgffTypeMap.get(type); taskList.add(task); } else { LinkedList<Task> taskList = new LinkedList<Task>(); taskList.add(task); tgffTypeMap.put(type, taskList); } application.addVertex(task); }  }
ReaderTGFF { protected void addTask(String line, String suffix, double period, Application<Task, Dependency> application) { String[] entries = line.trim().split(SEPARATOR); assert entries.length >= 4 : "tgff-file \"" + TASK + "\": wrong number of entries"; String id = entries[1] + suffix; String type = entries[3]; Task task = new Task(id); task.setAttribute(PERIOD, period); task.setAttribute(TGFF_TYPE, type); if (tgffTypeMap.containsKey(type)) { List<Task> taskList = tgffTypeMap.get(type); taskList.add(task); } else { LinkedList<Task> taskList = new LinkedList<Task>(); taskList.add(task); tgffTypeMap.put(type, taskList); } application.addVertex(task); }  SpecificationTypeBased read(String filename); SpecificationTypeBased read(File file); SpecificationTypeBased read(InputStream in); SpecificationTypeBased toSpecification(List<String> in); }
ReaderTGFF { protected void addTask(String line, String suffix, double period, Application<Task, Dependency> application) { String[] entries = line.trim().split(SEPARATOR); assert entries.length >= 4 : "tgff-file \"" + TASK + "\": wrong number of entries"; String id = entries[1] + suffix; String type = entries[3]; Task task = new Task(id); task.setAttribute(PERIOD, period); task.setAttribute(TGFF_TYPE, type); if (tgffTypeMap.containsKey(type)) { List<Task> taskList = tgffTypeMap.get(type); taskList.add(task); } else { LinkedList<Task> taskList = new LinkedList<Task>(); taskList.add(task); tgffTypeMap.put(type, taskList); } application.addVertex(task); }  SpecificationTypeBased read(String filename); SpecificationTypeBased read(File file); SpecificationTypeBased read(InputStream in); SpecificationTypeBased toSpecification(List<String> in); static final String TGFF_TYPE; static final String PERIOD; static final String MSG_SIZE; static final String RES_ATTRIBUTES; static final String RES_VALUES; static final String HARD_DEADLINE; static final String SOFT_DEADLINE; static final String WIRE; }