Package cn.sliew.milky.common.unit
Class ByteValue
- java.lang.Object
-
- cn.sliew.milky.common.unit.ByteValue
-
- All Implemented Interfaces:
Comparable<ByteValue>
public class ByteValue extends Object implements Comparable<ByteValue>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ByteValue other)booleanequals(Object o)longgetBytes()longgetGb()doublegetGbFrac()longgetKb()doublegetKbFrac()longgetMb()doublegetMbFrac()longgetPb()doublegetPbFrac()longgetTb()doublegetTbFrac()inthashCode()static ByteValueparseByteValue(String value)static ByteValueparseByteValue(String value, ByteValue defaultValue)StringtoString()
-
-
-
Field Detail
-
ZERO
public static final ByteValue ZERO
-
-
Constructor Detail
-
ByteValue
public ByteValue(long bytes)
-
ByteValue
public ByteValue(long size, ByteUnit unit)
-
-
Method Detail
-
getBytes
public long getBytes()
-
getKb
public long getKb()
-
getMb
public long getMb()
-
getGb
public long getGb()
-
getTb
public long getTb()
-
getPb
public long getPb()
-
getKbFrac
public double getKbFrac()
-
getMbFrac
public double getMbFrac()
-
getGbFrac
public double getGbFrac()
-
getTbFrac
public double getTbFrac()
-
getPbFrac
public double getPbFrac()
-
parseByteValue
public static ByteValue parseByteValue(String value) throws ValueParseException
- Throws:
ValueParseException
-
parseByteValue
public static ByteValue parseByteValue(String value, ByteValue defaultValue) throws ValueParseException
- Throws:
ValueParseException
-
compareTo
public int compareTo(ByteValue other)
- Specified by:
compareToin interfaceComparable<ByteValue>
-
-