Class/Object

com.twitter.util

StorageUnit

Related Docs: object StorageUnit | package util

Permalink

class StorageUnit extends Ordered[StorageUnit]

Representation of storage units.

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

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

val size: StorageUnit = 10.kilobytes
Note

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

,

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).

Linear Supertypes
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. All

Instance Constructors

  1. new StorageUnit(bytes: Long)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def *(scalar: Long): StorageUnit

    Permalink
  4. def *(scalar: Double): StorageUnit

    Permalink
  5. def +(that: StorageUnit): StorageUnit

    Permalink
  6. def -(that: StorageUnit): StorageUnit

    Permalink
  7. def /(scalar: Long): StorageUnit

    Permalink
  8. def <(that: StorageUnit): Boolean

    Permalink
    Definition Classes
    Ordered
  9. def <=(that: StorageUnit): Boolean

    Permalink
    Definition Classes
    Ordered
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def >(that: StorageUnit): Boolean

    Permalink
    Definition Classes
    Ordered
  12. def >=(that: StorageUnit): Boolean

    Permalink
    Definition Classes
    Ordered
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. val bytes: Long

    Permalink
  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def compare(other: StorageUnit): Int

    Permalink
    Definition Classes
    StorageUnit → Ordered
  17. def compareTo(that: StorageUnit): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  18. def divide(scalar: Long): StorageUnit

    Permalink
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(other: Any): Boolean

    Permalink
    Definition Classes
    StorageUnit → AnyRef → Any
  21. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    StorageUnit → AnyRef → Any
  24. def inBytes: Long

    Permalink
  25. def inExabytes: Long

    Permalink
  26. def inGigabytes: Long

    Permalink
  27. def inKilobytes: Long

    Permalink
  28. def inMegabytes: Long

    Permalink
  29. def inPetabytes: Long

    Permalink
  30. def inTerabytes: Long

    Permalink
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. def max(other: StorageUnit): StorageUnit

    Permalink
  33. def min(other: StorageUnit): StorageUnit

    Permalink
  34. def minus(that: StorageUnit): StorageUnit

    Permalink
  35. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. def plus(that: StorageUnit): StorageUnit

    Permalink
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. def times(scalar: Long): StorageUnit

    Permalink
  41. def times(scalar: Double): StorageUnit

    Permalink
  42. def toHuman(): String

    Permalink
  43. def toString(): String

    Permalink
    Definition Classes
    StorageUnit → AnyRef → Any
  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Ordered[StorageUnit]

Inherited from Comparable[StorageUnit]

Inherited from AnyRef

Inherited from Any

Ungrouped