|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.util.concurrent.Memory
public class Memory
Value representing an amount of Memory, as measured in memory
units
.
Nested Class Summary | |
---|---|
static class |
Memory.MemoryComparator
Comparator for units . |
static class |
Memory.Unit
Units in which memory is expressed. |
static class |
Memory.UnitComparator
Comparator for units . |
Method Summary | |
---|---|
long |
bytes()
The number of bytes represented by this instance. |
static Memory |
bytes(long number)
Construct a Memory represented in bytes. |
boolean |
equals(Object obj)
|
static Memory |
gigabytes(long number)
Construct a Memory represented in gigabytes. |
int |
hashCode()
|
static Memory |
kilobytes(long number)
Construct a Memory represented in kilobytes. |
static Memory |
megabytes(long number)
Construct a Memory represented in megabytes. |
long |
number()
The number of units this represents. |
static Memory |
of(long number,
Memory.Unit unit)
Construct a Memory represented in the supplied unit type. |
static Memory |
terabytes(long number)
Construct a Memory represented in terabytes. |
Memory |
to(Memory.Unit unit)
Convert to the supplied unit representation. |
String |
toString()
|
Memory.Unit |
unit()
The memory Memory.Unit this is represented in. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Memory of(long number, Memory.Unit unit)
public static Memory bytes(long number)
public static Memory kilobytes(long number)
public static Memory megabytes(long number)
public static Memory gigabytes(long number)
public static Memory terabytes(long number)
public long number()
units
this represents.
public Memory.Unit unit()
Memory.Unit
this is represented in.
public long bytes()
public Memory to(Memory.Unit unit)
This may involve a loss of precision if the Unit is greater than the current representation. This will always round down to the nearest complete Unit. 2043B will be 1KB for instance.
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |