com.android.sdklib.devices
Class Storage

java.lang.Object
  extended by com.android.sdklib.devices.Storage

public class Storage
extends java.lang.Object


Nested Class Summary
static class Storage.Unit
           
 
Constructor Summary
Storage(long amount)
           
Storage(long amount, Storage.Unit unit)
           
 
Method Summary
 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.
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Storage

public Storage(long amount,
               Storage.Unit unit)

Storage

public Storage(long amount)
Method Detail

getSize

public long getSize()
Returns the amount of storage represented, in Bytes


deepCopy

@NonNull
public Storage deepCopy()

getSizeAsUnit

public long getSizeAsUnit(@NonNull
                          Storage.Unit unit)
Return the amount of storage represented by the instance in the given unit

Parameters:
unit - The unit of the result.
Returns:
The size of the storage in the given unit.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getAppropriateUnits

@NonNull
public Storage.Unit getAppropriateUnits()
Finds the largest Storage.Unit which can display the storage value as a positive integer with no loss of accuracy.

Returns:
The most appropriate Storage.Unit.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object