RutaBlock parent) {
String rn = feature.getRange().getName();
if (rn.equals(UIMAConstants.TYPE_BOOLEAN)) {
Boolean v1 = afs.getBooleanValue(feature);
if (arg instanceof BooleanExpression) {
BooleanExpression expr = (BooleanExpression) 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 NumberExpression) {
NumberExpression expr = (NumberExpression) 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 NumberExpression) {
NumberExpression expr = (NumberExpression) 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 NumberExpression) {
NumberExpression expr = (NumberExpression) arg;
Float v2 = expr.getFloatValue(parent, afs, stream);
return compare(v1, v2);
}
} else if (rn.equals(UIMAConstants.TYPE_STRING)) {
String v1 = afs.getStringValue(feature);
if (arg instanceof StringExpression) {
StringExpression expr = (StringExpression) arg;
String v2 = expr.getStringValue(parent, afs, stream);
return compare(v1, v2);
}
}
return false;
}