LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.data
Class LyDateValue

java.lang.Object
  extended by leon.data.LyValue
      extended by leon.data.LyFieldInfoValue
          extended by leon.data.LyDateValue

public final class LyDateValue
extends LyFieldInfoValue

This class offers methods for constructing, accessing and modifying values corresponding to a LyDateFieldInfo.

See Also:
LyDateFieldInfo, LyObject

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyDateValue(LyDateFieldInfo dateFieldInfo)
          Constructs an empty date value for the given date field.
LyDateValue(LyDateFieldInfo dateFieldInfo, java.util.Date value)
          Constructs a date value for the given date field from a Date.
LyDateValue(LyDateFieldInfo dateFieldInfo, long value)
          Constructs a date value for the given date field from a long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.
LyDateValue(LyDateFieldInfo dateFieldInfo, java.lang.Long value)
          Constructs a date value for the given date field from a Long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.
LyDateValue(LyDateFieldInfo dateFieldInfo, java.lang.String value)
          Constructs a date value for the given date field from a string.
 
Method Summary
 java.util.Date getDateValue()
          Gets value of this date value as a Date.
 java.lang.Long getLongValue()
          Gets value of this date value as a long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.
 long longValue()
          Gets value of this date value as a long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.
 
Methods inherited from class leon.data.LyFieldInfoValue
compare, contains, equals, equals, getFieldInfo, getName, getName, getShortName, getString
 
Methods inherited from class leon.data.LyValue
getField, getValue, isNull, setValue, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyDateValue

public LyDateValue(LyDateFieldInfo dateFieldInfo)
Constructs an empty date value for the given date field.

Parameters:
dateFieldInfo - Date fieldInfo for which a value is created.

LyDateValue

public LyDateValue(LyDateFieldInfo dateFieldInfo,
                   java.lang.String value)
Constructs a date value for the given date field from a string.

Parameters:
dateFieldInfo - Date fieldInfo for which a value is created.
value - String value as expected by parse method.
See Also:
LyDateFieldInfo.parse(java.lang.String, java.lang.String)

LyDateValue

public LyDateValue(LyDateFieldInfo dateFieldInfo,
                   java.util.Date value)
Constructs a date value for the given date field from a Date. Depending on date type, this method extracts from the given Date requiered elements (day, month, year, hour, minutes, seconds, week, day_of_week).

Parameters:
dateFieldInfo - Date fieldInfo for which a value is created.
value - Date value.

LyDateValue

public LyDateValue(LyDateFieldInfo dateFieldInfo,
                   java.lang.Long value)
Constructs a date value for the given date field from a Long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.

Parameters:
dateFieldInfo - Date fieldInfo for which a value is created.
value - The milliseconds since January 1, 1970, 00:00:00 GMT.

LyDateValue

public LyDateValue(LyDateFieldInfo dateFieldInfo,
                   long value)
Constructs a date value for the given date field from a long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.

Parameters:
dateFieldInfo - Date fieldInfo for which a value is created.
value - The milliseconds since January 1, 1970, 00:00:00 GMT.
Method Detail

getDateValue

public java.util.Date getDateValue()
Gets value of this date value as a Date.

Returns:
A Date corresponding to this value.
Throws:
java.lang.IllegalStateException - If the value can't be returned as a Date (the internal type of the date field is not a Date).

getLongValue

public java.lang.Long getLongValue()
Gets value of this date value as a long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.

Returns:
A Long corresponding to this value.
Throws:
java.lang.IllegalStateException - If the value can't be returned as a Long.

longValue

public long longValue()
Gets value of this date value as a long representing the number of milliseconds since January 1, 1970, 00:00:00 GMT.

Returns:
A long corresponding to this value.
Throws:
java.lang.IllegalStateException - If the value can't be returned as a long.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com