Search in sources :

Example 1 with SimpleExpression

use of aQute.bnd.osgi.resource.FilterParser.SimpleExpression in project bndtools by bndtools.

the class R5LabelFormatter method formatRangeString.

public static String formatRangeString(RangeExpression range) {
    StringBuilder sb = new StringBuilder();
    SimpleExpression low = range.getLow();
    if (low == null) {
        sb.append("[0");
    } else {
        if (low.getOp() == Op.GREATER)
            sb.append("(");
        else
            sb.append("[");
        sb.append(low.getValue());
    }
    sb.append(", ");
    SimpleExpression high = range.getHigh();
    if (high == null) {
        // INFINITY Unicode: U+221E, UTF-8: E2 88 9E
        sb.append("∞]");
    } else {
        sb.append(high.getValue());
        if (high.getOp() == Op.LESS)
            sb.append(")");
        else
            sb.append("]");
    }
    return sb.toString();
}
Also used : SimpleExpression(aQute.bnd.osgi.resource.FilterParser.SimpleExpression)

Aggregations

SimpleExpression (aQute.bnd.osgi.resource.FilterParser.SimpleExpression)1