Example #1
0
 boolean evaluate(QConObject constraint, InternalCandidate candidate, Object obj) {
   if (obj != null) {
     if (obj instanceof ByteArrayBuffer) {
       obj = StringHandler.readString(candidate.transaction().context(), (ByteArrayBuffer) obj);
     }
     String candidateStringValue = obj.toString();
     String stringConstraint = constraint.getObject().toString();
     if (!caseSensitive) {
       candidateStringValue = candidateStringValue.toLowerCase();
       stringConstraint = stringConstraint.toLowerCase();
     }
     return compareStrings(candidateStringValue, stringConstraint);
   }
   return constraint.getObject() == null;
 }
Example #2
0
 public int compare(Tree to) {
   return StringHandler.compare(
       Const4.stringIO.write(_key), Const4.stringIO.write(((TreeString) to)._key));
 }