public class Storage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Storage.Unit |
Constructor and Description |
---|
Storage(long amount) |
Storage(long amount,
Storage.Unit unit) |
Modifier and Type | Method and Description |
---|---|
Storage |
deepCopy() |
boolean |
equals(java.lang.Object o) |
Storage.Unit |
getAppropriateUnits()
Finds the largest
Storage.Unit which can display the storage value as a positive integer
with no loss of accuracy. |
double |
getPreciseSizeAsUnit(Storage.Unit unit)
Returns the amount of storage represented by the instance in the given unit
as a double to get a more precise result
|
long |
getSize()
Returns the amount of storage represented, in Bytes
|
long |
getSizeAsUnit(Storage.Unit unit)
Return the amount of storage represented by the instance in the given unit
|
int |
hashCode() |
java.lang.String |
toString() |
public Storage(long amount, Storage.Unit unit)
public Storage(long amount)
public long getSize()
@NonNull public Storage deepCopy()
public long getSizeAsUnit(@NonNull Storage.Unit unit)
unit
- The unit of the result.public double getPreciseSizeAsUnit(@NonNull Storage.Unit unit)
unit
- The unit of the result.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NonNull public Storage.Unit getAppropriateUnits()
Storage.Unit
which can display the storage value as a positive integer
with no loss of accuracy.Storage.Unit
.public java.lang.String toString()
toString
in class java.lang.Object