com.davisor.data
Class MomentData

java.lang.Object
  extended byjava.util.Date
      extended bycom.davisor.data.TimestampData
          extended bycom.davisor.data.MomentData
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Data, DataValue, com.davisor.core.Dupable, java.io.Serializable, SerializableData

public class MomentData
extends TimestampData

Moment is like a timestamp but when it is added to or subtracted from any other time/date value, the result will be the given moment.

Since:
JDK1.1
See Also:
MomentType, Serialized Form

Field Summary
 
Fields inherited from class com.davisor.data.TimestampData
M_type, NaT
 
Constructor Summary
MomentData()
          Create a new date data object with the current date and default type.
MomentData(DateFormatType type)
          Create a new moment data object with the current time and given type.
MomentData(DateFormatType type, java.util.Date value)
          Create a new moment data object with the given type and value.
MomentData(DateFormatType type, long milliseconds)
          Create a new moment data object with the given type and value.
MomentData(DateFormatType type, java.lang.String stringValue, java.text.ParsePosition status)
          Creates a moment data value from a string value.
MomentData(MomentData data, boolean deep)
          Deep or shallow copy constructor.
 
Method Summary
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 
Methods inherited from class com.davisor.data.TimestampData
abs, add, ceil, ceil, compareTo, compareTo, createCalendar, deinterpolate, div, floor, floor, getFormat, getType, initTime, interpolate, isNull, max, min, mul, negate, setTime, setValue, sub, toStatement, toString, toXML, unit
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MomentData

public MomentData()
Create a new date data object with the current date and default type.


MomentData

public MomentData(MomentData data,
                  boolean deep)
Deep or shallow copy constructor. If it is shallow, then the new object shares an underlying type with the original object. If it is deep, then the type is dupped.

Parameters:
data - source data (may be null)
deep - determine if the copying is deep or shallow
See Also:
TimestampData.getType(), Type.dup()

MomentData

public MomentData(DateFormatType type)
Create a new moment data object with the current time and given type.

Parameters:
type - moment type

MomentData

public MomentData(DateFormatType type,
                  java.util.Date value)
Create a new moment data object with the given type and value.

Parameters:
type - date type
value - date value (may be null)
See Also:
MomentData(DateFormatType,long)

MomentData

public MomentData(DateFormatType type,
                  long milliseconds)
Create a new moment data object with the given type and value.

Parameters:
type - date type
milliseconds - date value
See Also:
MomentData(DateFormatType,java.util.Date), TimestampData.initTime(com.davisor.data.DateFormatType, long)

MomentData

public MomentData(DateFormatType type,
                  java.lang.String stringValue,
                  java.text.ParsePosition status)
           throws InvalidDataException
Creates a moment data value from a string value.

Parameters:
stringValue - string value to be parsed
status - parse status (may be null)
Throws:
InvalidDataException - if string value could not be parser
See Also:
TimestampData.setValue(String,ParsePosition)
Method Detail

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Overrides:
dup in class TimestampData


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.