Exemplo n.º 1
0
  /** Remove duplicate just for Montage Set in reducer.method */
  public void removeDuplicateMontage() {

    List jobList = this.getTaskList();
    for (int i = 0; i < jobList.size(); i++) {
      Task node = (Task) jobList.get(i);
      String name = node.getType();
      if (name.equals("mBackground")) {
        // remove all of its parents of mProjectPP

        for (int j = 0; j < node.getParentList().size(); j++) {

          Task parent = (Task) node.getParentList().get(j);
          if (parent.getType().equals("mProjectPP")) {
            j--;
            node.getParentList().remove(parent);
            parent.getChildList().remove(node);
          }
        }

      } else if (name.equals("mAdd")) {
        for (int j = 0; j < node.getParentList().size(); j++) {

          Task parent = (Task) node.getParentList().get(j);
          String pName = parent.getType();
          if (pName.equals("mBackground") || pName.equals("mShrink")) {
            j--;
            node.getParentList().remove(parent);
            parent.getChildList().remove(node);
          }
        }
      }
    }
  }