Package org.gedcomx.date
Class GedcomxDateApproximate
- java.lang.Object
-
- org.gedcomx.date.GedcomxDate
-
- org.gedcomx.date.GedcomxDateApproximate
-
- All Implemented Interfaces:
Comparable<GedcomxDate>
public class GedcomxDateApproximate extends GedcomxDate
An Approximate Date- Author:
- John Clark.
-
-
Constructor Summary
Constructors Constructor Description GedcomxDateApproximate(String date)Instantiate a new approximate date
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(GedcomxDate other)Calls thecompareTomethod on the simple date that this GedcomxDateApproximate contains.IntegergetDay()Get the dayIntegergetHours()Get the hoursIntegergetMinutes()Get the minutesIntegergetMonth()Get the monthIntegergetSeconds()Get the secondsGedcomxDateSimplegetSimpleDate()Return the underlying simple dateGedcomxDateTypegetType()The type of this dateIntegergetTzHours()Get the timezone hoursIntegergetTzMinutes()Get the timezone minutesIntegergetYear()Get the yearbooleanisApproximate()Whether or not this date is approximateStringtoFormalString()Returns the formal representation of this date
-
-
-
Constructor Detail
-
GedcomxDateApproximate
public GedcomxDateApproximate(String date)
Instantiate a new approximate date- Parameters:
date- The formal date string
-
-
Method Detail
-
getSimpleDate
public GedcomxDateSimple getSimpleDate()
Return the underlying simple date- Returns:
- The Simple Date
-
getType
public GedcomxDateType getType()
The type of this date- Specified by:
getTypein classGedcomxDate- Returns:
- The Type
-
isApproximate
public boolean isApproximate()
Whether or not this date is approximate- Specified by:
isApproximatein classGedcomxDate- Returns:
- True
-
toFormalString
public String toFormalString()
Returns the formal representation of this date- Specified by:
toFormalStringin classGedcomxDate- Returns:
- The formal String
-
getYear
public Integer getYear()
Get the year- Returns:
- The Year
-
getMonth
public Integer getMonth()
Get the month- Returns:
- The Month
-
getDay
public Integer getDay()
Get the day- Returns:
- The Day
-
getHours
public Integer getHours()
Get the hours- Returns:
- The Hours
-
getMinutes
public Integer getMinutes()
Get the minutes- Returns:
- The Minutes
-
getSeconds
public Integer getSeconds()
Get the seconds- Returns:
- The Seconds
-
getTzHours
public Integer getTzHours()
Get the timezone hours- Returns:
- The Timezone Hours
-
getTzMinutes
public Integer getTzMinutes()
Get the timezone minutes- Returns:
- The Timezone Minutes
-
compareTo
public int compareTo(GedcomxDate other)
Calls thecompareTomethod on the simple date that this GedcomxDateApproximate contains. SeeGedcomxDateSimple.compareTo(GedcomxDate)for more information- Specified by:
compareToin interfaceComparable<GedcomxDate>- Overrides:
compareToin classGedcomxDate- Parameters:
other- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
-