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.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- StorageUnit
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def *(scalar: Long): StorageUnit
- def *(scalar: Double): StorageUnit
- def +(that: StorageUnit): StorageUnit
- def -(that: StorageUnit): StorageUnit
- def /(scalar: Long): StorageUnit
- def <(that: StorageUnit): Boolean
- Definition Classes
- Ordered
- def <=(that: StorageUnit): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: StorageUnit): Boolean
- Definition Classes
- Ordered
- def >=(that: StorageUnit): Boolean
- Definition Classes
- Ordered
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val bytes: Long
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compare(other: StorageUnit): Int
- Definition Classes
- StorageUnit → Ordered
- def compareTo(that: StorageUnit): Int
- Definition Classes
- Ordered → Comparable
- def divide(scalar: Long): StorageUnit
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- StorageUnit → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- StorageUnit → AnyRef → Any
- def inBytes: Long
- def inExabytes: Long
- def inGigabytes: Long
- def inKilobytes: Long
- def inMegabytes: Long
- def inPetabytes: Long
- def inTerabytes: Long
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def max(other: StorageUnit): StorageUnit
- def min(other: StorageUnit): StorageUnit
- def minus(that: StorageUnit): StorageUnit
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def plus(that: StorageUnit): StorageUnit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def times(scalar: Long): StorageUnit
- def times(scalar: Double): StorageUnit
- def toHuman(): String
- def toString(): String
- Definition Classes
- StorageUnit → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()