org.gedcomx.util.date
Class Duration

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

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

public class Duration
extends Object

Class representing a Duration in a GedcomX formal date. The form of a Duration string is P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]] for a duration in years, months, days, hours, minutes and/or seconds. User: Randy Wilson Date: 8/8/13 Time: 6:37 PM


Constructor Summary
Duration(Integer year, Integer month, Integer day, Integer hour, Integer minute, Integer second)
          Deprecated. Constructor that fully specifies all of the fields.
Duration(String durationString)
          Deprecated. Constructor that takes a valid duration string and parses it into a Duration object.
 
Method Summary
 Integer getDay()
          Deprecated. Get the duration day, or null if not specified.
 Integer getHour()
          Deprecated. Get the duration hour, or null if not specified.
 Integer getMinute()
          Deprecated. Get the duration minute, or null if not specified.
 Integer getMonth()
          Deprecated. Get the duration month, or null if not specified.
 Integer getSecond()
          Deprecated. Get the duration second, or null if not specified.
 Integer getYear()
          Deprecated. Get the duration year, or null if not specified.
 boolean isValid()
          Deprecated. Tell whether the Duration is valid, which means that at least one of its values is non-null, and none exceeds the 2-digit limit (or 4 digits for year).
 void setDay(Integer day)
          Deprecated. Set the duration day.
 void setHour(Integer hour)
          Deprecated. Set the duration hour.
 void setMinute(Integer minute)
          Deprecated. Set the duration minute.
 void setMonth(Integer month)
          Deprecated. Set the duration month.
 void setSecond(Integer second)
          Deprecated. Set the duration second.
 void setYear(Integer year)
          Deprecated. Set the duration year.
 String toString()
          Deprecated. Convert this Duration to the canonical string for a Duration, of the form: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]] for use in a GedcomX formal date string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration(Integer year,
                Integer month,
                Integer day,
                Integer hour,
                Integer minute,
                Integer second)
Deprecated. 
Constructor that fully specifies all of the fields.

Parameters:
year - - Duration in years, or null if not set.
month - - Duration in months, or null if not set.
day - - Duration in days, or null if not set.
hour - - Duration in hours, or null if not set.
minute - - Duration in minutes, or null if not set.
second - - Duration in seconds, or null if not set.

Duration

public Duration(String durationString)
Deprecated. 
Constructor that takes a valid duration string and parses it into a Duration object.

Parameters:
durationString - - String of the form "P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]" that specifies a duration.
Method Detail

getYear

public Integer getYear()
Deprecated. 
Get the duration year, or null if not specified.

Returns:
the duration year, or null if not specified.

setYear

public void setYear(Integer year)
Deprecated. 
Set the duration year.

Parameters:
year - - duration year, or null if not specified.

getMonth

public Integer getMonth()
Deprecated. 
Get the duration month, or null if not specified.

Returns:
the duration month, or null if not specified.

setMonth

public void setMonth(Integer month)
Deprecated. 
Set the duration month.

Parameters:
month - - duration month, or null if not specified.

getDay

public Integer getDay()
Deprecated. 
Get the duration day, or null if not specified.

Returns:
the duration day, or null if not specified.

setDay

public void setDay(Integer day)
Deprecated. 
Set the duration day.

Parameters:
day - - duration day, or null if not specified.

getHour

public Integer getHour()
Deprecated. 
Get the duration hour, or null if not specified.

Returns:
the duration hour, or null if not specified.

setHour

public void setHour(Integer hour)
Deprecated. 
Set the duration hour.

Parameters:
hour - - duration hour, or null if not specified.

getMinute

public Integer getMinute()
Deprecated. 
Get the duration minute, or null if not specified.

Returns:
the duration minute, or null if not specified.

setMinute

public void setMinute(Integer minute)
Deprecated. 
Set the duration minute.

Parameters:
minute - - duration minute, or null if not specified.

getSecond

public Integer getSecond()
Deprecated. 
Get the duration second, or null if not specified.

Returns:
the duration second, or null if not specified.

setSecond

public void setSecond(Integer second)
Deprecated. 
Set the duration second.

Parameters:
second - - duration second, or null if not specified.

toString

public String toString()
Deprecated. 
Convert this Duration to the canonical string for a Duration, of the form: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]] for use in a GedcomX formal date string.

Overrides:
toString in class Object
Returns:
canonical String representation of this Duration.

isValid

public boolean isValid()
Deprecated. 
Tell whether the Duration is valid, which means that at least one of its values is non-null, and none exceeds the 2-digit limit (or 4 digits for year).

Returns:
true if valid, false otherwise.


Copyright © 2015. All rights reserved.