public class Size extends Object
Once created, an instance of this class is immutable. All operations that modify this will return new objects.
Modifier and Type | Class and Description |
---|---|
static class |
Size.Unit |
Modifier and Type | Method and Description |
---|---|
static Size |
bytes(long bytes) |
Size |
convertTo(Size.Unit target) |
boolean |
equals(Object obj) |
Size.Unit |
getUnit() |
double |
getValue() |
int |
hashCode() |
static Size |
parse(String toParse)
Parses a string (such as "1.0 KiB") into a size.
|
String |
toString()
Returns a simplified and human-readable version of this Size
|
String[] |
toStringParts()
Returns a human-readable version of this Size, appropriate for localization.
|
public Size(double amount, Size.Unit unit)
public double getValue()
public Size.Unit getUnit()
public String toString()
public String[] toStringParts()
public static Size bytes(long bytes)
Copyright © 2015. All Rights Reserved.