private boolean affectationJalon(String taskCode, Value exp) { TaskImpl result = new TaskImpl(timeline, taskCode); result.setStart(((ValueTime) exp).getValue()); result.setDuration(0); tasks.add(result); knowledge.set(taskCode, exp); return true; }
private boolean affectationTask(String taskCode, String attribute, Value exp) { final TaskImpl t = getOrCreateTask(taskCode); final TaskAttribute att = TaskAttribute.fromString(attribute); if (att == TaskAttribute.START) { t.setStart(((ValueTime) exp).getValue()); return true; } if (att == TaskAttribute.DURATION) { t.setDuration(((ValueInt) exp).getValue()); return true; } if (att == TaskAttribute.LOAD) { t.setLoad(((ValueInt) exp).getValue()); return true; } throw new UnsupportedOperationException(); }