case LESS_THAN: return Cmp.LESS_THAN;
case LESS_THAN_EQUAL: return Cmp.LESS_THAN_EQUAL;
default: throw new IllegalArgumentException("Unexpected comparator: " + comp);
}
} else if (p instanceof Compare) {
Compare comp = (Compare)p;
switch(comp) {
case EQUAL: return Cmp.EQUAL;
case NOT_EQUAL: return Cmp.NOT_EQUAL;
case GREATER_THAN: return Cmp.GREATER_THAN;
case GREATER_THAN_EQUAL: return Cmp.GREATER_THAN_EQUAL;