|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.AbstractXmlObject
com.waveset.util.Util.TimePeriod
Used to represent a time period, such as number of days, weeks or months, relative to an arbitrary day.
Field Summary | |
static java.lang.String |
ELEMENT
Name of the serialized XML element. |
Fields inherited from class com.waveset.util.AbstractXmlObject |
_trace, code_id |
Constructor Summary | |
Util.TimePeriod()
Build a default time period, zero days. |
|
Util.TimePeriod(org.w3c.dom.Element e)
Construct a time period by parsing its DOM representation. |
|
Util.TimePeriod(Util.TimeUnit unit,
int count)
Build a time unit specifying the unit and count. |
Method Summary | |
java.util.Date |
add(java.util.Date start)
Add the time period to a date, and return the relative date. |
java.lang.Object |
clone()
Clone the TimePeriod. |
Util.TimePeriod |
copy()
A more convenient clone. |
int |
getCount()
Get the time unit count. |
java.lang.String |
getElementName()
Return the element name. |
Util.TimeUnit |
getUnit()
Get the time unit. |
void |
setCount(int c)
Set the time unit count. |
void |
setUnit(Util.TimeUnit u)
Set the time unit. |
java.util.Date |
subtract(java.util.Date start)
Subtract the time period from a date, and return the relative date. |
Util.TimePeriod |
subtract(Util.TimePeriod p)
Subtract the specified time period from this time period and return a time period jsl - can't we use the Calendar class for much of this? |
void |
toXml(java.lang.StringBuffer b,
int indent)
Serialize the time period to an XML buffer. |
Methods inherited from class com.waveset.util.AbstractXmlObject |
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ELEMENT
Constructor Detail |
public Util.TimePeriod()
public Util.TimePeriod(Util.TimeUnit unit, int count)
public Util.TimePeriod(org.w3c.dom.Element e)
Method Detail |
public java.lang.String getElementName()
AbstractXmlObject
getElementName
in interface XmlObject
getElementName
in class AbstractXmlObject
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public Util.TimePeriod copy()
public Util.TimeUnit getUnit()
public void setUnit(Util.TimeUnit u)
public int getCount()
public void setCount(int c)
public java.util.Date add(java.util.Date start)
public java.util.Date subtract(java.util.Date start)
public Util.TimePeriod subtract(Util.TimePeriod p)
public void toXml(java.lang.StringBuffer b, int indent)
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |