Compare (query directive)
Revision as of 10:50, 20 August 2009
Description
Compares the values of two roles in the input column. The directive constructor is given a comparison operator as a string. It can be one of "==", "!=", "<", ">", "<=", ">=" or various aliases of these commonly used in programming languages. It can also be one of two topic map related operators "t=" or "t!=". These compare the equality or inequality, respectively, of topics instead of numeric or string representations the values.
Constructor
Compare(String role1,String comp,String role2)
Compare(String role1,String comp,String role2,boolean numeric) - If numeric is true, converts the values to numbers before comparing
Notes
The where method present in every directive can be given three strings corresponding to the first constructor. A new Compare directive will be implicitly created. A.where("r1","==","r2") will resolve to new From(new Compare("r1","==","r2"),A).