Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public Task getTask(String code) {
   for (TaskImpl t : tasks) {
     if (t.getCode().equals(code)) {
       return t;
     }
   }
   Task result = null;
   for (Task t : tasks) {
     if (t.getCode().startsWith(code) == false) {
       continue;
     }
     if (result == null) {
       result = t;
     } else {
       result = new TaskMerge(result.getCode(), result.getName(), result, t);
     }
   }
   return result;
 }