ezvcard.types
Class DeathdateType

java.lang.Object
  extended by ezvcard.types.VCardType
      extended by ezvcard.types.DateOrTimeType
          extended by ezvcard.types.DeathdateType
All Implemented Interfaces:
Comparable<VCardType>

public class DeathdateType
extends DateOrTimeType

Defines the person's time of death.

Setting the time of death

 VCard vcard = new VCard();
 
 //complete date
 Calendar c = Calendar.getInstance();
 c.set(Calendar.YEAR, 1954);
 c.set(Calendar.MONTH, Calendar.JUNE);
 c.set(Calendar.DAY_OF_MONTH, 7);
 DeathdateType deathdate = new DeathdateType();
 deathdate.setDate(c.getTime(), false);
 vcard.setDeathdate(deathdate);
 
 //reduced accuracy date
 deathdate = new DeathdateType();
 deathdate.setReducedAccuracyDate("--0607"); //June 7
 vcard.setDeathdate(deathdate);
 
 //plain text value
 deathdate = new DeathdateType();
 deathdate.setText("circa 1954");
 vcard.setDeathdate(deathdate);
 

Getting the time of death

 VCard vcard = ...
 DeathdateType deathdate = vcard.getDeathdate();
 if (deathdate != null){
   if (deathdate.getDate() != null){
     System.out.println(deathdate.getDate());
   } else if (deathdate.getReducedAccuracyDate() != null){
     System.out.println(deathdate.getReducedAccuracyDate());
   } else if (deathdate.getText() != null){
     System.out.println(deathdate.getText());
   }
 }
 

vCard property name: DEATHDATE

vCard versions: 4.0

Author:
Michael Angstadt
See Also:
RFC 6474

Field Summary
static String NAME
           
 
Fields inherited from class ezvcard.types.VCardType
group, subTypes, typeName
 
Constructor Summary
DeathdateType()
           
DeathdateType(Date date)
           
 
Method Summary
 String getLanguage()
          Gets the LANGUAGE parameter.
 VCardVersion[] getSupportedVersions()
          Gets the vCard versions that support this type.
 void setLanguage(String language)
          Sets the LANGUAGE parameter.
 
Methods inherited from class ezvcard.types.DateOrTimeType
doMarshalSubTypes, doMarshalText, doMarshalXml, doUnmarshalHtml, doUnmarshalText, doUnmarshalXml, getAltId, getCalscale, getDate, getReducedAccuracyDate, getText, setAltId, setCalsclae, setDate, setReducedAccuracyDate, setText
 
Methods inherited from class ezvcard.types.VCardType
compareTo, getGroup, getQName, getSubTypes, getTypeName, marshalSubTypes, marshalText, marshalXml, setGroup, unmarshalHtml, unmarshalText, unmarshalXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

DeathdateType

public DeathdateType()

DeathdateType

public DeathdateType(Date date)
Parameters:
date - the time of death
Method Detail

getSupportedVersions

public VCardVersion[] getSupportedVersions()
Description copied from class: VCardType
Gets the vCard versions that support this type.

Overrides:
getSupportedVersions in class VCardType
Returns:
the vCard versions that support this type.

getLanguage

public String getLanguage()
Gets the LANGUAGE parameter.

Returns:
the language or null if not set
See Also:
VCardSubTypes.getLanguage()

setLanguage

public void setLanguage(String language)
Sets the LANGUAGE parameter.

Parameters:
language - the language or null to remove
See Also:
VCardSubTypes.setLanguage(java.lang.String)


Copyright © 2012-2013. All Rights Reserved.