| Constructor and Description |
|---|
ResourcesTimeUnit() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
long |
getMaxQuantity()
The maximum quantity of this Unit to be used as a threshold for the next largest Unit (e.g.
|
long |
getMillisPerUnit()
The number of milliseconds represented by each instance of this TimeUnit.
|
protected String |
getResourceBundleName() |
protected abstract String |
getResourceKeyPrefix()
Return the name of the resource bundle from which this unit's format should be loaded.
|
int |
hashCode() |
boolean |
isPrecise()
Whether or not this
TimeUnit represents a price measurement of time, or a general concept of time. |
void |
setMaxQuantity(long maxQuantity) |
void |
setMillisPerUnit(long millisPerUnit) |
String |
toString() |
protected abstract String getResourceKeyPrefix()
protected String getResourceBundleName()
public long getMaxQuantity()
TimeUnitSecond represents 1000ms, and Second has a maxQuantity of 5, then if the difference
between compared timestamps is larger than 5000ms, PrettyTime will move on to the next smallest TimeUnit for
calculation; Minute, by default)
millisPerUnit * maxQuantity = maxAllowedMs
If maxQuantity is zero, it will be equal to the next highest TimeUnit.getMillisPerUnit() /
this.getMillisPerUnit() or infinity if there are no greater TimeUnits
getMaxQuantity in interface TimeUnitpublic void setMaxQuantity(long maxQuantity)
public long getMillisPerUnit()
TimeUnitgetMillisPerUnit in interface TimeUnitpublic void setMillisPerUnit(long millisPerUnit)
public boolean isPrecise()
TimeUnitTimeUnit represents a price measurement of time, or a general concept of time. E.g:
"minute" as opposed to "moment".Copyright © 2015 OCPsoft. All Rights Reserved.