com.anwrt.commons.hessian.model
Class HessianDate

java.lang.Object
  extended by com.anwrt.commons.hessian.model.HessianValue
      extended by com.anwrt.commons.hessian.model.HessianSimple
          extended by com.anwrt.commons.hessian.model.HessianDate

public class HessianDate
extends HessianSimple

Models a date represented by a 64-bit long or 32-bit int switch date type of milliseconds or seconds since the Jan 1 1970 00:00H, UTC.
creation : 26 sept. 2008

Author:
David FRANCOIS

Field Summary
static int MILLISECOND
          Date type millisecond.
static int SECOND
          Date type millisecond.
 
Constructor Summary
HessianDate(java.util.Date value)
           
HessianDate(java.util.Date value, int mode)
          Constructor
 
Method Summary
 java.lang.String getTypeString()
           
 java.util.Date getValue()
           
 void render(java.io.OutputStream os, AwtHessianSerializer ser)
          Renders the HessianValue to the given OutputStream.
 void setMode(int mode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLISECOND

public static final int MILLISECOND
Date type millisecond. Serialized date will be in millisecond.

See Also:
Constant Field Values

SECOND

public static final int SECOND
Date type millisecond. Serialized date will be in second.

See Also:
Constant Field Values
Constructor Detail

HessianDate

public HessianDate(java.util.Date value,
                   int mode)
Constructor

Parameters:
value - Date to be serialized
mode - serialization type.

HessianDate

public HessianDate(java.util.Date value)
Parameters:
value - Date to be serialized in millisecond.
Method Detail

setMode

public void setMode(int mode)

getValue

public java.util.Date getValue()

getTypeString

public java.lang.String getTypeString()
Overrides:
getTypeString in class HessianValue

render

public void render(java.io.OutputStream os,
                   AwtHessianSerializer ser)
            throws AwtHessianSerializerException
Description copied from class: HessianValue
Renders the HessianValue to the given OutputStream.

Specified by:
render in class HessianValue
Parameters:
os - to which to render
ser - an AwtHessianSerializer instance
Throws:
AwtHessianSerializerException