public class SubDirFilter
extends Object
Modifier and Type | Field and Description |
---|---|
private HashSet<String> |
ancestors |
private HashSet<String> |
targets |
Constructor and Description |
---|
SubDirFilter() |
Modifier and Type | Method and Description |
---|---|
void |
add(File dirFile)
Adds a directory to the set.
|
private ArrayList<String> |
ancestorOrSelf(File dir)
Make a list of the directory and all its ancestors.
|
boolean |
approve(File dirFile)
Checks if the given directory is in the set, where "in" is defined as
having an ancestor or descendant within the set.
|
boolean |
approve(String dir)
Checks if the given directory is in the set, where "in" is defined as
having an ancestor or descendant within the set.
|
List<String> |
getTargets()
Get a list of all targets in lexicographic order.
|
boolean |
isEmpty()
Tell if nothing has been added yet
|
int |
size()
Returns the number of targets that have been added to the filter.
|
public boolean isEmpty()
public void add(File dirFile)
public int size()
public List<String> getTargets()
public boolean approve(String dir)
public boolean approve(File dirFile)
private ArrayList<String> ancestorOrSelf(File dir)