Package com.aoindustries.io
Class ByteCount
- java.lang.Object
-
- com.aoindustries.io.ByteCount
-
- All Implemented Interfaces:
Serializable,Comparable<ByteCount>
public class ByteCount extends Object implements Serializable, Comparable<ByteCount>
AByteCountconsists of a long quantity and an optional unit.- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classByteCount.Unit
-
Constructor Summary
Constructors Constructor Description ByteCount(long byteCount)ByteCount(long quantity, ByteCount.Unit unit)ByteCount(String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ByteCount o)booleanequals(Object O)Two BitRates are equal when they have the same quantity and the same unit.longgetByteCount()longgetQuantity()ByteCount.UnitgetUnit()inthashCode()StringtoString()static ByteCountvalueOf(String value)
-
-
-
Constructor Detail
-
ByteCount
public ByteCount(long byteCount)
-
ByteCount
public ByteCount(long quantity, ByteCount.Unit unit)- Parameters:
unit- ifnull, defaults to bits per second.
-
ByteCount
public ByteCount(String value)
-
-
Method Detail
-
equals
public boolean equals(Object O)
Two BitRates are equal when they have the same quantity and the same unit.- Overrides:
equalsin classObject- See Also:
compareTo(com.aoindustries.io.ByteCount)
-
compareTo
public int compareTo(ByteCount o)
- Specified by:
compareToin interfaceComparable<ByteCount>
-
getQuantity
public long getQuantity()
-
getUnit
public ByteCount.Unit getUnit()
-
getByteCount
public long getByteCount()
-
-