sdlip.helpers
Class QueryUtil
java.lang.Object
|
+--sdlip.helpers.QueryUtil
- public class QueryUtil
- extends java.lang.Object
This class provides functions to
manipulate boolean queries in DAV/DASL format.
Constructor Summary
Method Summary
static Element
canonicalDNF(Element q)
Translates boolean query into disjunctive normal form
whereas every path from root to leaf or negated leaf is or length 2.
static boolean
equals(org.w3c.dom.Node a,
org.w3c.dom.Node b)
Checks whether two elements are syntactically equivalent.
static boolean
isAND(Element q)
tests whether elements is an AND operator
static boolean
isBoolean(Element q)
tests whether elements is a boolean operator
static boolean
isFalse(Element q)
tests whether query evaluates to false
static boolean
isNOT(Element q)
tests whether elements is an NOT operator
static boolean
isOR(Element q)
tests whether elements is an OR operator
static boolean
isTrue(Element q)
tests whether query evaluates to true
static void
main(java.lang.String[] args)
Methods inherited from class java.lang.Object
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Constructor Detail
QueryUtil
public QueryUtil()
Method Detail
isAND
public static boolean isAND(Element q)
- tests whether elements is an AND operator
isOR
public static boolean isOR(Element q)
- tests whether elements is an OR operator
isNOT
public static boolean isNOT(Element q)
- tests whether elements is an NOT operator
isBoolean
public static boolean isBoolean(Element q)
- tests whether elements is a boolean operator
isTrue
public static boolean isTrue(Element q)
- tests whether query evaluates to true
isFalse
public static boolean isFalse(Element q)
- tests whether query evaluates to false
DNF
public static Element DNF(Element q)
- Translates boolean query into disjunctive normal form
canonicalDNF
public static Element canonicalDNF(Element q)
- Translates boolean query into disjunctive normal form
whereas every path from root to leaf or negated leaf is or length 2.
equals
public static boolean equals(org.w3c.dom.Node a,
org.w3c.dom.Node b)
- Checks whether two elements are syntactically equivalent.
Assumption: there is no whitespace in XML tree,
guaranteed by using sdlip.xml.dom.DOMParser (or XMLObject)
inside
public static Element inside(Element q)
- returns the single child of an element
main
public static void main(java.lang.String[] args)
throws java.lang.Exception