@ThreadSafe @Immutable public class ByteCount extends java.lang.Object implements java.lang.Comparable<ByteCount>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_FORMAT_PRECISION |
| Constructor and Description |
|---|
ByteCount(long byteCount) |
ByteCount(long count,
ByteUnit byteUnit) |
ByteCount(java.lang.String combinedByteCount) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
allocate() |
static byte[] |
allocate(ByteCount byteCount) |
static byte[] |
allocate(long byteCount) |
static byte[] |
allocate(long byteCount,
ByteUnit unit) |
static byte[] |
allocate(java.lang.String byteCount) |
java.nio.ByteBuffer |
allocateBuffer() |
static java.nio.ByteBuffer |
allocateBuffer(ByteCount byteCount) |
static java.nio.ByteBuffer |
allocateBuffer(long byteCount) |
static java.nio.ByteBuffer |
allocateBuffer(long byteCount,
ByteUnit unit) |
static java.nio.ByteBuffer |
allocateBuffer(java.lang.String byteCount) |
static ByteCount |
byteCount(long byteCount) |
static ByteCount |
byteCount(long byteCount,
ByteUnit unit) |
static ByteCount |
byteCount(java.lang.String byteCount) |
static ByteCount |
byteCountOf(long byteCount) |
static ByteCount |
byteCountOf(long byteCount,
ByteUnit unit) |
static ByteCount |
byteCountOf(java.lang.String byteCount) |
int |
compareTo(ByteCount other) |
ByteCount |
dividedBy(double what) |
ByteCount |
dividedBy(long what) |
boolean |
equals(java.lang.Object o) |
ByteUnit |
getBestFittingUnit() |
double |
getProcessInRelationTo(ByteCount current) |
boolean |
hasContent() |
int |
hashCode() |
long |
in(ByteUnit byteUnit) |
boolean |
isEmpty() |
boolean |
isGreaterThan(ByteCount other) |
boolean |
isGreaterThanOrEqualTo(ByteCount other) |
boolean |
isLessThan(ByteCount other) |
boolean |
isLessThanOrEqualTo(ByteCount other) |
ByteCount |
minus(ByteCount byteCount) |
ByteCount |
minus(long byteCount) |
ByteCount |
minus(long byteCount,
ByteUnit unit) |
ByteCount |
multiplyBy(double what) |
ByteCount |
multiplyBy(long what) |
protected static long |
parsePartValueOf(java.util.regex.Matcher matcher) |
ByteCount |
plus(ByteCount byteCount) |
ByteCount |
plus(long byteCount) |
ByteCount |
plus(long byteCount,
ByteUnit unit) |
ByteCount |
plus(java.lang.String byteCount) |
long |
toByteCount() |
static long |
toByteCount(java.lang.String combinedByteCount) |
int |
toByteCountForAllocation() |
java.lang.String |
toCombinedByteCount() |
static java.lang.String |
toCombinedByteCount(long byteCount) |
java.lang.String |
toFormattedByteCount() |
java.lang.String |
toFormattedByteCount(int precision) |
java.lang.String |
toFormattedByteCount(java.util.Locale locale) |
java.lang.String |
toFormattedByteCount(java.util.Locale locale,
int precision) |
java.lang.String |
toFormattedByteCountOf(ByteUnit unit) |
java.lang.String |
toFormattedByteCountOf(ByteUnit unit,
int precision) |
java.lang.String |
toFormattedByteCountOf(ByteUnit unit,
java.util.Locale locale) |
java.lang.String |
toFormattedByteCountOf(ByteUnit unit,
java.util.Locale locale,
int precision) |
java.lang.String |
toString() |
public static final int DEFAULT_FORMAT_PRECISION
public ByteCount(@Nonnegative
long byteCount)
public ByteCount(@Nonnegative
long count,
@Nonnull
ByteUnit byteUnit)
public ByteCount(@Nonnull
java.lang.String combinedByteCount)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException@Nonnegative
public static long toByteCount(@Nonnull
java.lang.String combinedByteCount)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException@Nonnegative
protected static long parsePartValueOf(@Nonnull
java.util.regex.Matcher matcher)
@Nonnull
public static java.lang.String toCombinedByteCount(@Nonnegative
long byteCount)
@Nullable public static ByteCount byteCount(@Nullable java.lang.String byteCount)
@Nonnull public static ByteCount byteCount(@Nonnegative long byteCount)
@Nonnull public static ByteCount byteCount(@Nonnegative long byteCount, @Nonnull ByteUnit unit)
@Nullable public static ByteCount byteCountOf(@Nullable java.lang.String byteCount)
@Nonnull public static ByteCount byteCountOf(@Nonnegative long byteCount)
@Nonnull public static ByteCount byteCountOf(@Nonnegative long byteCount, @Nonnull ByteUnit unit)
@Nonnull
public static byte[] allocate(@Nonnull
java.lang.String byteCount)
@Nonnull
public static byte[] allocate(@Nonnegative
long byteCount)
@Nonnull
public static byte[] allocate(@Nonnegative
ByteCount byteCount)
@Nonnull
public static byte[] allocate(@Nonnegative
long byteCount,
@Nonnull
ByteUnit unit)
@Nonnull
public static java.nio.ByteBuffer allocateBuffer(@Nonnull
java.lang.String byteCount)
@Nonnull
public static java.nio.ByteBuffer allocateBuffer(@Nonnegative
long byteCount)
@Nonnull
public static java.nio.ByteBuffer allocateBuffer(@Nonnegative
ByteCount byteCount)
@Nonnull
public static java.nio.ByteBuffer allocateBuffer(@Nonnegative
long byteCount,
@Nonnull
ByteUnit unit)
@Nonnegative public long toByteCount()
@Nonnull public byte[] allocate()
@Nonnull public java.nio.ByteBuffer allocateBuffer()
@Nonnegative
public int toByteCountForAllocation()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException - if this byteCount exceeds Integer.MAX_VALUE.@Nonnegative
public long in(@Nonnull
ByteUnit byteUnit)
@Nonnull public java.lang.String toCombinedByteCount()
@Nonnull
public java.lang.String toFormattedByteCountOf(@Nonnull
ByteUnit unit)
@Nonnull
public java.lang.String toFormattedByteCountOf(@Nonnull
ByteUnit unit,
@Nonnegative
int precision)
@Nonnull
public java.lang.String toFormattedByteCountOf(@Nonnull
ByteUnit unit,
@Nullable
java.util.Locale locale)
@Nonnull
public java.lang.String toFormattedByteCountOf(@Nonnull
ByteUnit unit,
@Nullable
java.util.Locale locale,
@Nonnegative
int precision)
@Nonnull public java.lang.String toFormattedByteCount()
@Nonnull
public java.lang.String toFormattedByteCount(@Nonnegative
int precision)
@Nonnull
public java.lang.String toFormattedByteCount(@Nullable
java.util.Locale locale)
@Nonnull
public java.lang.String toFormattedByteCount(@Nullable
java.util.Locale locale,
@Nonnegative
int precision)
@Nonnull public ByteUnit getBestFittingUnit()
@Nonnull public ByteCount plus(@Nonnegative long byteCount)
@Nonnull public ByteCount plus(@Nullable java.lang.String byteCount)
@Nonnull public ByteCount minus(@Nonnegative long byteCount)
@Nonnull public ByteCount multiplyBy(double what)
@Nonnull public ByteCount dividedBy(double what)
@Nonnull public ByteCount multiplyBy(long what)
@Nonnull public ByteCount dividedBy(long what)
@Nonnegative
public double getProcessInRelationTo(@Nonnull
ByteCount current)
public boolean isEmpty()
public boolean hasContent()
public boolean isLessThan(@Nonnull
ByteCount other)
public boolean isLessThanOrEqualTo(@Nonnull
ByteCount other)
public boolean isGreaterThan(@Nonnull
ByteCount other)
public boolean isGreaterThanOrEqualTo(@Nonnull
ByteCount other)
public int compareTo(@Nonnull
ByteCount other)
compareTo in interface java.lang.Comparable<ByteCount>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2013 echocat. All Rights Reserved.