org.gedcomx.util.date
Class FormalDate

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

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

public class FormalDate
extends Object

Class representing a fully parsed GedcomX standard date, for the purpose of creating or understanding GedcomX formal date strings. Format of a GedcomX formal dates are made up by strings of these types: Simple date: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss[(+\-)hh[:mm]|Z]]]]]] Duration: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]] Closed date Range: [simpleDate]/[simpleDate|Duration] Open-ended date range: [simpleDate]/ /[simpleDate] Recurring date R[repetitions]/simpleDate/(simpleDate|Duration) Approximate date or date range A(simpleDate) A(dateRange) => ([A](simpleDate|dateRange) | R[repetitions]/simpleDate/(simpleDate|Duration)) => [A]simpleDate [A]simpleDate/[simpleDate|Duration] [A]/simpleDate R[repetitions]/simpleDate/(simpleDate|Duration) User: Randy Wilson Date: 8/7/13 Time: 12:53 PM


Constructor Summary
FormalDate(String formalDateString)
          Deprecated. Constructor that parses a formal date string.
 
Method Summary
 Duration getDuration()
          Deprecated. Get the Duration portion of a FormalDate, or null if there is no duration.
 SimpleDate getEnd()
          Deprecated. Get the ending date for this FormalDate range.
 Integer getNumRepetitions()
          Deprecated. Get the number of repetitions for a recurring date, or null if none.
 SimpleDate getStart()
          Deprecated. Get the starting date for this FormalDate.
 boolean isApproximate()
          Deprecated. Tell whether this FormalDate is approximate.
 boolean isRange()
          Deprecated. Tell whether this date is a range.
 boolean isRecurring()
          Deprecated. Get the flag for whether this date is a repeating date.
 boolean isValid()
          Deprecated. Tell whether the current state of the date is valid for a GedcomX formal date.
 void setApproximate(boolean approximate)
          Deprecated. Set the flag for whether this date is approximate.
 void setDuration(Duration duration)
          Deprecated. Set the duration of a FormalDate.
 void setEnd(SimpleDate end)
          Deprecated. Set the ending date of this FormalDate range.
 void setNumRepetitions(Integer numRepetitions)
          Deprecated. Set the number of repetitions for a recurring date.
 void setRange(boolean range)
          Deprecated. Set the flag for whether this FormalDate is a range.
 void setRecurring(boolean recurring)
          Deprecated. Set the flag for whether this is a recurring date, in which case there must be a start date and either an end date or a duration (but not both).
 void setStart(SimpleDate start)
          Deprecated. Set the starting date.
 String toString()
          Deprecated. Convert a FormalDate to a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormalDate

public FormalDate(String formalDateString)
Deprecated. 
Constructor that parses a formal date string.

Parameters:
formalDateString - - Formal date string to parse.
Method Detail

isApproximate

public boolean isApproximate()
Deprecated. 
Tell whether this FormalDate is approximate.

Returns:
true if this FormalDate is approximate, false otherwise.

setApproximate

public void setApproximate(boolean approximate)
Deprecated. 
Set the flag for whether this date is approximate. Note that it is illegal to have an approximate repeating date.

Parameters:
approximate - - flag for whether this date is approximate.

isRange

public boolean isRange()
Deprecated. 
Tell whether this date is a range.

Returns:
true if this FormalDate is a range, false otherwise.

setRange

public void setRange(boolean range)
Deprecated. 
Set the flag for whether this FormalDate is a range.

Parameters:
range - - flag for whether this date is a range.

getStart

public SimpleDate getStart()
Deprecated. 
Get the starting date for this FormalDate. If the date is not a range, this is the whole date. If the date is a range, and this is null, then it implies "any time before the ending date". Must not be null if this FormalDate is not a range.

Returns:
Starting date for this FormalDate.

setStart

public void setStart(SimpleDate start)
Deprecated. 
Set the starting date. (If the date is not a range, this is the whole date).

Parameters:
start - - Starting date.

getEnd

public SimpleDate getEnd()
Deprecated. 
Get the ending date for this FormalDate range. If the starting date is null, then the FormalDate is interpreted as "any time up to this ending date". If the date is a range, and the end is null, then it means "any time from the starting date or later." If the date is not a range, the end must be null.

Returns:
ending date.

setEnd

public void setEnd(SimpleDate end)
Deprecated. 
Set the ending date of this FormalDate range. If the starting date is null, then the date is interpreted as "any time up to this ending time". If the date is a range, and the end is null, then it means "any time from the starting date or later". If the date is not a range, the end must be null. If the date is a range, then either the start or end must be non-null.

Parameters:
end -

getDuration

public Duration getDuration()
Deprecated. 
Get the Duration portion of a FormalDate, or null if there is no duration. If the duration is non-null, then the starting date must be non-null. A duration is used in a range or in a recurring date. Must be null if the end is non-null.

Returns:

setDuration

public void setDuration(Duration duration)
Deprecated. 
Set the duration of a FormalDate.

Parameters:
duration -

isRecurring

public boolean isRecurring()
Deprecated. 
Get the flag for whether this date is a repeating date. If so, then there must be a start date, and either an end date or a duration (but not both).

Returns:
flag for whether this is a recurring date.

setRecurring

public void setRecurring(boolean recurring)
Deprecated. 
Set the flag for whether this is a recurring date, in which case there must be a start date and either an end date or a duration (but not both).

Parameters:
recurring - - flag for whether this is a recurring date.

getNumRepetitions

public Integer getNumRepetitions()
Deprecated. 
Get the number of repetitions for a recurring date, or null if none.

Returns:
number of repetitions for a recurring date, or null if none.

setNumRepetitions

public void setNumRepetitions(Integer numRepetitions)
Deprecated. 
Set the number of repetitions for a recurring date. Ignored if the date is not recurring. If null, a recurring date is assumed to have no limit on the number of repetitions.

Parameters:
numRepetitions - - Number of repetitions for a recurring date, or null for no limit.

isValid

public boolean isValid()
Deprecated. 
Tell whether the current state of the date is valid for a GedcomX formal date. In particular, make sure it follows one of the following patterns: [A]simpleDate [A]simpleDate/[simpleDate|Duration] [A]/simpleDate R[repetitions]/simpleDate/(simpleDate|Duration)

Returns:
true if the date is completely valid, false if there are inconsistencies.

toString

public String toString()
Deprecated. 
Convert a FormalDate to a string

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


Copyright © 2015. All rights reserved.