Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats.element
Class DateElement

java.lang.Object
  extended by com.jivesoftware.base.stats.Element
      extended by com.jivesoftware.base.stats.element.DateElement
All Implemented Interfaces:
java.lang.Comparable

public class DateElement
extends Element

An Element which is specialized for handling Dates.


Constructor Summary
DateElement(java.util.Date date)
          Creates a new DateElement
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare DateElement to another DateElement using the embedded Date's compareTo method
 boolean equals(java.lang.Object obj)
          See if this DateElement equals another
 Element getInstance(long n)
          Get a new DateElement instance.
 java.lang.Object getValue()
          Returns the object this element wraps.
 int hashCode()
          Generate a hashCode for the DateElement so we can insert DateElements into hashtables
 java.lang.Long toLong()
          Convert the embedded Date to a Long using getTime().
 java.lang.String toString()
          Convert the DateElement to a String using the embedded Date's toString() method.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateElement

public DateElement(java.util.Date date)
Creates a new DateElement

Parameters:
date - the initial date value.
Method Detail

getValue

public java.lang.Object getValue()
Returns the object this element wraps.

Specified by:
getValue in class Element
Returns:
the object this element wraps.

toLong

public java.lang.Long toLong()
Convert the embedded Date to a Long using getTime(). The resulting Long will be the time elapsed since 1970 in milliseconds.

Overrides:
toLong in class Element
Returns:
a Long representation of the internal Date.

getInstance

public Element getInstance(long n)
Get a new DateElement instance.

Specified by:
getInstance in class Element
Parameters:
n - Time in milliseconds since 1970
Returns:
a new DateElement with embedded Date given by new Date(t)

toString

public java.lang.String toString()
Convert the DateElement to a String using the embedded Date's toString() method.

Overrides:
toString in class Element
Returns:
a String representation of this element's value.

compareTo

public int compareTo(java.lang.Object o)
Compare DateElement to another DateElement using the embedded Date's compareTo method


hashCode

public int hashCode()
Generate a hashCode for the DateElement so we can insert DateElements into hashtables

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
See if this DateElement equals another

Overrides:
equals in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.