org.gedcomx.util.date
Class SimpleDate

java.lang.Object
  extended by org.gedcomx.util.date.SimpleDate

Deprecated. See org.gedcomx.date.GedcomxDateUtil and org.gedcomx.date.GedcomxDateSimple.

public class SimpleDate
extends Object

"Simple date" string is generally: (+|-)YYYY-MM-DDThh:mm:ss((+\-)hh:mm|Z) or, using square brackets around optional parts: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss[(+\-)hh[:mm]|Z]]]]]]


Constructor Summary
SimpleDate(int year)
          Deprecated. Constructure that takes only a year, where -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 9999 = 9999 A.D.
SimpleDate(int year, Integer month, Integer day, Integer hour, Integer minute, Integer second, boolean isUTC, Integer timeZoneHours, Integer timeZoneMinutes)
          Deprecated. Constructor with a complete set of parameters.
SimpleDate(String simpleDateString)
          Deprecated. Parse a GedcomX "simple date" string of the form: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss]][Z|(+|-)hh[:mm]]]]]
 
Method Summary
 Integer getDay()
          Deprecated. Get the day of the month as an integer from 1..31.
 Integer getHour()
          Deprecated. Get the hour of the day as an integer from 0 (=midnight) to 23(=11 p.m.)
 Integer getMinute()
          Deprecated. Get the minute of the hour as an Integer (0..59).
 Integer getMonth()
          Deprecated. Get the month as an Integer, where 1=January and 12=December.
 Integer getSecond()
          Deprecated. Get the second of the minute as an Integer (0..59).
 Integer getTimeZoneHours()
          Deprecated. Get the hour offset from GMT of the time zone.
 Integer getTimeZoneMinutes()
          Deprecated. Get the hour minutes of the time zone.
 int getYear()
          Deprecated. Get the year as an integer.
 boolean isUTC()
          Deprecated. Get a flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.
 boolean isValid()
          Deprecated. Tell whether this SimpleDate is valid.
 void setDay(Integer day)
          Deprecated. Get the day of the month as an integer from 1..31.
 void setHour(Integer hour)
          Deprecated. Set the hour of the day as an Integer from 0 (=midnight) to 23 (=11 p.m.).
 void setMinute(Integer minute)
          Deprecated. Set the minute of the hour as an Integer (0..59) Must be null if there is no hour.
 void setMonth(Integer month)
          Deprecated. Set the month number as an integer, where 1=January and 12=December.
 void setSecond(Integer second)
          Deprecated. Set the second of the minute as an Integer (0..59) Must be null if there is no minute.
 void setTimeZoneHours(Integer timeZoneHours)
          Deprecated. Set the hour offset from GMT of the time zone.
 void setTimeZoneMinutes(Integer timeZoneMinutes)
          Deprecated. Set the minute offset of the time zone.
 void setUTC(boolean UTC)
          Deprecated. Set the flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.
 void setYear(int year)
          Deprecated. Set the year as an integer.
 String toString()
          Deprecated. Convert the SimpleDate to a formal GedcomX simple date string, of the form: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss]][(+\-)hh[:mm]|Z]]]]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleDate

public SimpleDate(int year)
Deprecated. 
Constructure that takes only a year, where -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 9999 = 9999 A.D.

Parameters:
year - - year

SimpleDate

public SimpleDate(String simpleDateString)
Deprecated. 
Parse a GedcomX "simple date" string of the form: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss]][Z|(+|-)hh[:mm]]]]]

Parameters:
simpleDateString - - string to parse

SimpleDate

public SimpleDate(int year,
                  Integer month,
                  Integer day,
                  Integer hour,
                  Integer minute,
                  Integer second,
                  boolean isUTC,
                  Integer timeZoneHours,
                  Integer timeZoneMinutes)
Deprecated. 
Constructor with a complete set of parameters.

Parameters:
year: - -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 9999 = 9999 A.D.
month: - 1..12, or null
day: - 1..31, or null (must be null if month is null)
hour: - 0..23 (must be null if day is null)
minute: - 0..59 (must be null if hour is null)
second: - 0..59 (must be null if minute is null)
isUTC: - true => UTC time zone (i.e., use "Z" in string).
timeZoneHours: - -23..23 (must be null if isUTC, or if hour is null)
timeZoneMinutes: - 00..59 (can be null if 0; must be null if timeZoneHours is null)
Method Detail

isValid

public boolean isValid()
Deprecated. 
Tell whether this SimpleDate is valid. In particular, make sure that there are no specific date or time parts for which the more general parts are null, and make sure that if isUTC is set, then the time zone hours and minutes are null.

Returns:
true if the date looks valid, false if there is a problem.

toString

public String toString()
Deprecated. 
Convert the SimpleDate to a formal GedcomX simple date string, of the form: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss]][(+\-)hh[:mm]|Z]]]]

Overrides:
toString in class Object
Returns:
formal GedcomX simple date string.

getYear

public int getYear()
Deprecated. 
Get the year as an integer. Positive years are treated as C.E. (A.D.); Negative years are one less than the B.C.E. (B.C.) year. For example, -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 2000 = 2000 A.D.; 9999 = 9999 A.D.

Returns:
year portion of a GedcomX "simple" date.

setYear

public void setYear(int year)
Deprecated. 
Set the year as an integer. Positive years are treated as C.E. (A.D.); Negative years are one less than the B.C.E. (B.C.) year. For example, -9999 = 10000 B.C.; -1 = 2 B.C.; 0 = 1 B.C.; 1 = 1 A.D.; 2000 = 2000 A.D.; 9999 = 9999 A.D.

Parameters:
year - - year portion of a GedcomX simple date.

getMonth

public Integer getMonth()
Deprecated. 
Get the month as an Integer, where 1=January and 12=December.

Returns:
Month number (1..12), or null if there is no month.

setMonth

public void setMonth(Integer month)
Deprecated. 
Set the month number as an integer, where 1=January and 12=December.

Parameters:
month - - Month number (1..12), or null if there is no month.

getDay

public Integer getDay()
Deprecated. 
Get the day of the month as an integer from 1..31.

Returns:
Day number (1..31), or null if there is no day.

setDay

public void setDay(Integer day)
Deprecated. 
Get the day of the month as an integer from 1..31.

Parameters:
day - - Day number (1..31), or null if there is no day.

getHour

public Integer getHour()
Deprecated. 
Get the hour of the day as an integer from 0 (=midnight) to 23(=11 p.m.)

Returns:
Hour of the day (0..23) or null if there is no hour.

setHour

public void setHour(Integer hour)
Deprecated. 
Set the hour of the day as an Integer from 0 (=midnight) to 23 (=11 p.m.). Must be null if there is no day.

Parameters:
hour - - Hour of the day (0..23) or null if there is no hour.

getMinute

public Integer getMinute()
Deprecated. 
Get the minute of the hour as an Integer (0..59). Must be null if there is no hour.

Returns:
Minute (0..59), or null if there is no minute.

setMinute

public void setMinute(Integer minute)
Deprecated. 
Set the minute of the hour as an Integer (0..59) Must be null if there is no hour.

Parameters:
minute - - Minute of the hour (0..59), or null if there is no minute.

getSecond

public Integer getSecond()
Deprecated. 
Get the second of the minute as an Integer (0..59). Must be null if there is no minute.

Returns:
Second (0..59), or null if there is no second.

setSecond

public void setSecond(Integer second)
Deprecated. 
Set the second of the minute as an Integer (0..59) Must be null if there is no minute.

Parameters:
second - - Minute of the minute (0..59), or null if there is no second.

isUTC

public boolean isUTC()
Deprecated. 
Get a flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.

Returns:
true if this SimpleDate uses UTC; false otherwise.

setUTC

public void setUTC(boolean UTC)
Deprecated. 
Set the flag for whether this SimpleDate uses a time in Universal Time Code (UTC), in which case "Z" is used in the string, and the time zone hours and minutes are ignored.


getTimeZoneHours

public Integer getTimeZoneHours()
Deprecated. 
Get the hour offset from GMT of the time zone. Ignored if isUTC or if the hours is null.

Returns:
Time zone hours, or null if not set.

setTimeZoneHours

public void setTimeZoneHours(Integer timeZoneHours)
Deprecated. 
Set the hour offset from GMT of the time zone. Ignored if isUTC or if the hours is null.

Parameters:
timeZoneHours - - Time zone hours, or null if not used.

getTimeZoneMinutes

public Integer getTimeZoneMinutes()
Deprecated. 
Get the hour minutes of the time zone. Ignored if isUTC or if the timeZoneHours is null.

Returns:
Time zone minutes, or null if not set.

setTimeZoneMinutes

public void setTimeZoneMinutes(Integer timeZoneMinutes)
Deprecated. 
Set the minute offset of the time zone. Ignored if isUTC or if the timeZoneHours is null.

Parameters:
timeZoneMinutes - - Time zone minutes, or null if not used.


Copyright © 2015. All rights reserved.