|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.tools.generic.ComparisonDateTool.Comparison
public class ComparisonDateTool.Comparison
Field Summary | |
---|---|
private boolean |
abbreviate
|
private java.util.Locale |
locale
|
private int |
maxUnitDepth
|
private long |
milliseconds
|
private int |
type
|
Constructor Summary | |
---|---|
ComparisonDateTool.Comparison(long ms,
int type,
int depth,
boolean abbr,
java.util.Locale loc)
|
Method Summary | |
---|---|
ComparisonDateTool.Comparison |
abbr(boolean abbr)
Sets whether or not this comparison is to be rendered in abbreviated form or not. |
ComparisonDateTool.Comparison |
depth(int depth)
Set the maximum number of units to render for this comparison. |
ComparisonDateTool.Comparison |
getAbbr()
This is equivalent to calling abbr(boolean abbr) with
true as the argument, thus setting this comparison to be
rendered in abbreviated form. |
long |
getDays()
Return the number of days between the dates being compared. |
ComparisonDateTool.Comparison |
getDifference()
Sets this comparison to be rendered as a ComparisonDateTool.difference(java.lang.Object, java.lang.Object) . |
ComparisonDateTool.Comparison |
getFull()
Sets the depth(int depth) to which this comparison is rendered
to the maximum number of time units available to the tool. |
long |
getHours()
Return the number of hours between the dates being compared. |
long |
getMilliseconds()
Return the number of milliseconds between the dates being compared. |
long |
getMinutes()
Return the number of minutes between the dates being compared. |
long |
getMonths()
Return the approximate number of months between the dates being compared. |
ComparisonDateTool.Comparison |
getRelative()
Sets this comparison to be rendered as if it where generated using the ComparisonDateTool.whenIs(Object now, Object then) method. |
long |
getSeconds()
Return the number of seconds between the dates being compared. |
long |
getWeeks()
Return the number of weeks between the dates being compared. |
long |
getYears()
Return the approximate number of years between the dates being compared. |
ComparisonDateTool.Comparison |
locale(java.util.Locale loc)
Sets the locale used to look up the textual portions of the rendering. |
java.lang.String |
toString()
Renders this comparison to a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private long milliseconds
private int type
private int maxUnitDepth
private boolean abbreviate
private java.util.Locale locale
Constructor Detail |
---|
public ComparisonDateTool.Comparison(long ms, int type, int depth, boolean abbr, java.util.Locale loc)
Method Detail |
---|
public ComparisonDateTool.Comparison abbr(boolean abbr)
public ComparisonDateTool.Comparison depth(int depth)
public ComparisonDateTool.Comparison locale(java.util.Locale loc)
public long getYears()
public long getMonths()
public long getWeeks()
public long getDays()
public long getHours()
public long getMinutes()
public long getSeconds()
public long getMilliseconds()
public ComparisonDateTool.Comparison getFull()
depth(int depth)
to which this comparison is rendered
to the maximum number of time units available to the tool. By default,
there are 8 units available, but the tool may be configured to "skip"
any of the standard units, thus shortening the maximum depth.
public ComparisonDateTool.Comparison getDifference()
ComparisonDateTool.difference(java.lang.Object, java.lang.Object)
. This effectively means that
the comparison will render as a period of time, without any suffix
to describe the relative position of the dates being compared (e.g. "later"
or "ago").
public ComparisonDateTool.Comparison getRelative()
ComparisonDateTool.whenIs(Object now, Object then)
method.
This effectively means that the comparison will render with a suffix
to describe the relative position of the dates being compared (e.g. "later"
or "ago").
public ComparisonDateTool.Comparison getAbbr()
abbr(boolean abbr)
with
true
as the argument, thus setting this comparison to be
rendered in abbreviated form.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |