File: NumericWithUnitToken.java

package info (click to toggle)
liblessen-java 1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: java: 2,981; xml: 31; makefile: 5
file content (15 lines) | stat: -rw-r--r-- 442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package com.metaweb.lessen.tokens;

public class NumericWithUnitToken extends NumericToken {
    final public String unit;
    
    public NumericWithUnitToken(Type type, int start, int end, String text, Number n, String unit) {
        super(type, start, end, text, n);
        this.unit = unit;
    }

    @Override
    public String getCleanText() {
        return unit.equals("px") ? (n.intValue() + unit) : super.getCleanText();
    }
}