|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSubDirFilter
public class SubDirFilter
This class provides an efficient means to determine if a given subdirectory is "in" or "out" of the set of directories specified to index. Essentially, if a given directory has an ancestor or a descendant in the set, it qualifies. That is, ancestors and cousins of the set directories will be indexed, but not necessarily all the cousins, nephews, nieces, etc.
Field Summary | |
---|---|
private HashSet<String> |
ancestors
|
private HashSet<String> |
targets
|
Constructor Summary | |
---|---|
SubDirFilter()
|
Method Summary | |
---|---|
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private HashSet<String> targets
private HashSet<String> ancestors
Constructor Detail |
---|
public SubDirFilter()
Method Detail |
---|
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |