예제 #1
0
  /**
   * Constructs an instance of the BreadthFirstIterator class wrapping the Iterator of Iterators to
   * collectively traverse the Iterators in order, left to right, top to bottom.
   *
   * @param iterators the Iterator of Iterators to encapsulate in a breadth-first traversal.
   * @throws java.lang.NullPointerException if the Iterator of Iterators reference is null.
   * @see java.util.Iterator
   */
  public BreadthFirstIterator(final Iterator<Iterator<T>> iterators) {
    Assert.notNull(iterators, "The Iterator of Iterators must not be null!");

    for (Iterator<T> iterator : CollectionUtils.iterable(iterators)) {
      if (iterator != null) {
        this.iterators.add(iterator);
      }
    }
  }
예제 #2
0
 /**
  * Constructs an instance of the {@link RegexFileFilter} class initialized with the given regular
  * expression (regex), expressed as a {@link Pattern}.
  *
  * @param regularExpression regular expression (regex) used to match and filter {@link File}s.
  * @throws IllegalArgumentException if the regular expression {@link Pattern} is null.
  * @see java.util.regex.Pattern
  */
 public RegexFileFilter(Pattern regularExpression) {
   Assert.notNull(regularExpression, "The Regular Expression (Pattern) cannot be null");
   this.regularExpression = regularExpression;
 }