示例#1
0
  /**
   * Checks if <code>root</code> is inside <code>list</code> that must be a <code>parseAssign()
   * </code> ArrayList.
   *
   * @param root
   * @param list
   */
  public static boolean isAssignedRoot(DiskFilter filter, Root root, ArrayList<AssignParser> list) {
    for (AssignParser a : list) {
      if (a.allAssigned()) return true;

      int i = a.getRoot();
      Root o = filter.getRootList().get(i - 1);
      if (o.equals(root)) {
        return true;
      }
    }
    return false;
  }
示例#2
0
  /**
   * Iterates throught a <code>parseAssign()</code> ArrayList and add the current assigned scores to
   * the ScoreChart <code>sc</code>
   *
   * @param list
   * @param sc
   */
  public static void addScoresToChart(
      DiskFilter filter, ArrayList<AssignParser> list, ScoreChart sc) {
    for (AssignParser ap : list) {

      if (ap.allAssigned()) return;

      int i = ap.getRoot();

      Root r = filter.getRootList().get(i - 1);

      if (ap.getScore() == Integer.MIN_VALUE) {
        sc.removeFromChart(r);
      } else {
        sc.addScore(r, ap.getScore());
      }
    }
  }