Packages

class StorageUnit extends Ordered[StorageUnit]

Representation of storage units.

Use either StorageUnit.fromX or com.twitter.conversions.storage implicit conversions from Long and Int to construct instances.

import com.twitter.conversions.StorageUnitOps._
import com.twitter.util.StorageUnit

val size: StorageUnit = 10.kilobytes
Note

While all the methods in this abstraction are prefixed according to the International System of Units (kilo-, mega-, etc), they actually operate on the 1024 scale (not 1000).

,

Operations can cause overflows of the Long used to represent the number of bytes.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StorageUnit
  2. Ordered
  3. Comparable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new StorageUnit(bytes: Long)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *(scalar: Long): StorageUnit
  4. def *(scalar: Double): StorageUnit
  5. def +(that: StorageUnit): StorageUnit
  6. def -(that: StorageUnit): StorageUnit
  7. def /(scalar: Long): StorageUnit
  8. def <(that: StorageUnit): Boolean
    Definition Classes
    Ordered
  9. def <=(that: StorageUnit): Boolean
    Definition Classes
    Ordered
  10. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def >(that: StorageUnit): Boolean
    Definition Classes
    Ordered
  12. def >=(that: StorageUnit): Boolean
    Definition Classes
    Ordered
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. val bytes: Long
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  16. def compare(other: StorageUnit): Int
    Definition Classes
    StorageUnit → Ordered
  17. def compareTo(that: StorageUnit): Int
    Definition Classes
    Ordered → Comparable
  18. def divide(scalar: Long): StorageUnit
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(other: Any): Boolean
    Definition Classes
    StorageUnit → AnyRef → Any
  21. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  22. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def hashCode(): Int
    Definition Classes
    StorageUnit → AnyRef → Any
  24. def inBytes: Long
  25. def inExabytes: Long
  26. def inGigabytes: Long
  27. def inKilobytes: Long
  28. def inMegabytes: Long
  29. def inPetabytes: Long
  30. def inTerabytes: Long
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. def max(other: StorageUnit): StorageUnit
  33. def min(other: StorageUnit): StorageUnit
  34. def minus(that: StorageUnit): StorageUnit
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def plus(that: StorageUnit): StorageUnit
  39. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  40. def times(scalar: Long): StorageUnit
  41. def times(scalar: Double): StorageUnit
  42. def toHuman(): String
  43. def toString(): String
    Definition Classes
    StorageUnit → AnyRef → Any
  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Ordered[StorageUnit]

Inherited from Comparable[StorageUnit]

Inherited from AnyRef

Inherited from Any

Ungrouped