package flare.util
{
/**
* Utility methods for creating filter functions. The static
* $()
method takes an arbitrary object and generates a
* corresponding filter function.
*
*
Filter functions are functions that take one argument and return a
* Boolean
value. The input argument to a filter function
* passes the filter if the function returns true and fails the
* filter if the function returns false.
Function
, it is simply
* returned.IPredicate
, its
* predicate
function is returned.String
, a Property
* instance with the string as the property name is generated, and
* the predicate
function of the property is
* returned.Class
instance, a function that
* performs type-checking for that class type is returned.Class
type to check for
* @return a Boolean
-valued type checking filter function
*/
public static function typeChecker(type:Class):Function
{
return function(o:Object):Boolean { return o is type; }
}
} // end of class Filter
}