org.schmant.arg
Class DirectoryAndFilter

java.lang.Object
  extended by org.schmant.support.AbstractArgumentChecker
      extended by org.schmant.arg.DirectoryAndFilter

public class DirectoryAndFilter
extends AbstractArgumentChecker

This object represents a directory and an entity Filter. It can be used as an argument to directory-interpreting methods in ArgumentInterpreter.

It is up to the class using objects of this type to choose how to use the filter. Commonly, the filter is applied to filter the entities returned when iterating (recursively or not) over the directory's child entities.

Since:
0.5
Author:
Karl Gustafsson

Constructor Summary
DirectoryAndFilter(Object o, Filter<? super EntityView> f)
           
 
Method Summary
 Object getDirectory()
          Get the directory property.
 Filter<? super EntityView> getFilter()
          Get the filter property.
static List<DirectoryAndFilter> listWithFilter(Collection<?> c, Filter<? super EntityView> f)
          Create a list with DirectoryAndFilter objects for each element in the collection and return it.
 String toString()
           
 
Methods inherited from class org.schmant.support.AbstractArgumentChecker
check, check, check, check
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryAndFilter

public DirectoryAndFilter(Object o,
                          Filter<? super EntityView> f)
Method Detail

getDirectory

public Object getDirectory()
Get the directory property.

Returns:
The directory property.

getFilter

public Filter<? super EntityView> getFilter()
Get the filter property.

Returns:
The filter property.

listWithFilter

public static List<DirectoryAndFilter> listWithFilter(Collection<?> c,
                                                      Filter<? super EntityView> f)
Create a list with DirectoryAndFilter objects for each element in the collection and return it.

Parameters:
c - The collection.
f - The filter to use.
Returns:
A list of DirectoryAndFilter objects. The list is sorted in the order that the objects were returned when iterating over the supplied collection.

toString

public String toString()
Overrides:
toString in class Object