jdk/src/share/classes/java/nio/file/DirectoryStream.java
changeset 15647 314007859004
parent 9035 1255eb81cc2f
equal deleted inserted replaced
15646:b065aeb8e26b 15647:314007859004
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   115  *
   115  *
   116  * @see Files#newDirectoryStream(Path)
   116  * @see Files#newDirectoryStream(Path)
   117  */
   117  */
   118 
   118 
   119 public interface DirectoryStream<T>
   119 public interface DirectoryStream<T>
   120     extends Closeable, Iterable<T>
   120     extends Closeable, Iterable<T> {
   121 {
       
   122     /**
   121     /**
   123      * An interface that is implemented by objects that decide if a directory
   122      * An interface that is implemented by objects that decide if a directory
   124      * entry should be accepted or filtered. A {@code Filter} is passed as the
   123      * entry should be accepted or filtered. A {@code Filter} is passed as the
   125      * parameter to the {@link Files#newDirectoryStream(Path,DirectoryStream.Filter)}
   124      * parameter to the {@link Files#newDirectoryStream(Path,DirectoryStream.Filter)}
   126      * method when opening a directory to iterate over the entries in the
   125      * method when opening a directory to iterate over the entries in the
   128      *
   127      *
   129      * @param   <T>     the type of the directory entry
   128      * @param   <T>     the type of the directory entry
   130      *
   129      *
   131      * @since 1.7
   130      * @since 1.7
   132      */
   131      */
       
   132     @FunctionalInterface
   133     public static interface Filter<T> {
   133     public static interface Filter<T> {
   134         /**
   134         /**
   135          * Decides if the given directory entry should be accepted or filtered.
   135          * Decides if the given directory entry should be accepted or filtered.
   136          *
   136          *
   137          * @param   entry
   137          * @param   entry