Java Reference
In-Depth Information
retval = isEqual(operand,nodeValue);
}
if(test.equals("<>")){
not = true;
retval = isEqual(operand,nodeValue);
}
if(not)retval = !retval;
return retval;
}
private boolean isEqual(String operand,String nodeValue){
boolean retval = false;
operand = operand.trim();
if(nodeValue.equals(operand))retval = true;
return retval;
}
private boolean isLike(String operand,String nodeValue){
boolean retval = false;
if(operand.startsWith("%")){
if(operand.endsWith("%")){
operand = operand.replace('%',' ').trim();
if(nodeValue.indexOf(operand)>-1)retval = true;
}else{
operand = operand.replace('%',' ').trim();
if(nodeValue.endsWith(operand))retval = true;
}
}else if(operand.endsWith("%")){
operand = operand.replace('%',' ').trim();
if(nodeValue.startsWith(operand))retval = true;
}else{
operand = operand.trim();
if(nodeValue.equals(operand))retval = true;
}
return retval;
}
protected boolean evaluate(String infix){
int parens = 0;
Stack ops = new Stack();
Stack args = new Stack();
infix = infix.trim();
Search WWH ::




Custom Search