Package lcmc.common.domain

Examples of lcmc.common.domain.Unit


    public static Unit getUnitTiBytes(final String unitPart) {
        return new Unit("T", "t", "TiByte" + unitPart, "TiBytes" + unitPart);
    }

    public static Unit getUnitPiBytes(final String unitPart) {
        return new Unit("P", "p", "PiByte" + unitPart, "PiBytes" + unitPart);
    }
View Full Code Here


    public static Unit getUnitPiBytes(final String unitPart) {
        return new Unit("P", "p", "PiByte" + unitPart, "PiBytes" + unitPart);
    }

    public static Unit getUnitSectors(final String unitPart) {
        return new Unit("s", "s", "Sector" + unitPart, "Sectors" + unitPart);
    }
View Full Code Here

        }
        return units.toArray(new Unit[units.size()]);
    }

    public static Unit getUnitDefault(final String unitPart) {
        return new Unit("", "", "", "");
    }
View Full Code Here

    public static Unit getUnitDefault(final String unitPart) {
        return new Unit("", "", "", "");
    }

    public static Unit getUnitKi(final String unitPart) {
        return new Unit("k", "K", "k", "k");
    }
View Full Code Here

    public static Unit getUnitKi(final String unitPart) {
        return new Unit("k", "K", "k", "k");
    }
                   
    public static Unit getUnitMi(final String unitPart) {
        return new Unit("m", "M", "m", "m");
    }
View Full Code Here

    public static Unit getUnitMi(final String unitPart) {
        return new Unit("m", "M", "m", "m");
    }

    public static Unit getUnitGi(final String unitPart) {
        return new Unit("g", "G", "g", "g");
    }
View Full Code Here

    public static Unit getUnitGi(final String unitPart) {
        return new Unit("g", "G", "g", "g");
    }

    public static Unit getUnitTi(final String unitPart) {
        return new Unit("t", "T", "t", "t");
    }
View Full Code Here

    public static Unit getUnitTi(final String unitPart) {
        return new Unit("t", "T", "t", "t");
    }

    public static Unit getUnitPi(final String unitPart) {
        return new Unit("p", "P", "p", "p");
    }
View Full Code Here

        final Matcher m = UNIT_PATTERN.matcher(v);
        if (m.matches()) {
            final String value = m.group(1);
            final String u = m.group(2);

            final Unit unit = parseUnit(param, u);
            return new StringValue(value, unit);
        }
        return new StringValue(v);
    }
View Full Code Here

    }

    /** Converts value to unit e.g. bytes. */
    public BigInteger convertToUnit(final String param, final Value value) {
        final String unitPart = getUnitPart(getUnitLong(param));
        final Unit unit = value.getUnit();
        BigInteger num = new BigInteger(value.getValueForConfig());
        if (getUnitPiBytes(unitPart).equals(unit)
            || getUnitPi(unitPart).equals(unit)) {
            num = num.multiply(KILO)
                     .multiply(KILO)
View Full Code Here

TOP

Related Classes of lcmc.common.domain.Unit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.