// null is possibly coveredText
String rn = feature == null ? UIMAConstants.TYPE_STRING : feature.getRange().getName();
if (rn.equals(UIMAConstants.TYPE_BOOLEAN)) {
Boolean v1 = afs.getBooleanValue(feature);
if (arg instanceof IBooleanExpression) {
IBooleanExpression expr = (IBooleanExpression) arg;
Boolean v2 = expr.getBooleanValue(parent, afs, stream);
return compare(v1, v2);
}
} else if (rn.equals(UIMAConstants.TYPE_INTEGER) || rn.equals(UIMAConstants.TYPE_BYTE)
|| rn.equals(UIMAConstants.TYPE_SHORT) || rn.equals(UIMAConstants.TYPE_LONG)) {
Integer v1 = afs.getIntValue(feature);
if (arg instanceof INumberExpression) {
INumberExpression expr = (INumberExpression) arg;
Integer v2 = expr.getIntegerValue(parent, afs, stream);
return compare(v1, v2);
}
} else if (rn.equals(UIMAConstants.TYPE_DOUBLE)) {
Double v1 = afs.getDoubleValue(feature);
if (arg instanceof INumberExpression) {
INumberExpression expr = (INumberExpression) arg;
Double v2 = expr.getDoubleValue(parent, afs, stream);
return compare(v1, v2);
}
} else if (rn.equals(UIMAConstants.TYPE_FLOAT)) {
Float v1 = afs.getFloatValue(feature);
if (arg instanceof INumberExpression) {
INumberExpression expr = (INumberExpression) arg;
Float v2 = expr.getFloatValue(parent, afs, stream);
return compare(v1, v2);
}
} else if (rn.equals(UIMAConstants.TYPE_STRING)) {
String v1 = afs.getCoveredText();
// null is possibly coveredText
if (feature != null) {
v1 = afs.getStringValue(feature);
}
if (arg instanceof IStringExpression) {
IStringExpression expr = (IStringExpression) arg;
String v2 = expr.getStringValue(parent, afs, stream);
return compare(v1, v2);
}
}
return false;
}