Code example for Ordering

Methods: sortedCopy

0
  } 
 
  @Override 
  public final Set<T> getNextGroup(Set<T> idle, Set<T> active) {
    return FluentIterable
        .from(ordering.sortedCopy(doGetNextGroup(idle, active)))
        .limit(Math.max(0, maxActive - active.size()))
        .toSet();
  } 
 
  /** 
   * Delegate function for the subclass. The implementation may return as many or few results 
   * as they wish. If the result is larger than {@link #maxActive}, it will be truncated. 
   * 
   * @param idle Idle instances, candidate for being updated. 
   * @param active Instances currently being updated. 
   * @return A subset of {@code idle}, instances to start updating. 
   */ 
  abstract Set<T> doGetNextGroup(Set<T> idle, Set<T> active);
}