|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.property.VCardProperty
ezvcard.property.Timezone
public class Timezone
Contains the timezone that the person lives/works in.
Code sample
VCard vcard = new VCard(); Timezone tz = new Timezone(-5, 0, "America/New_York"); vcard.addTimezone(tz);
Property name: TZ
Supported versions: 2.1, 3.0, 4.0
Field Summary |
---|
Fields inherited from class ezvcard.property.VCardProperty |
---|
group, parameters |
Constructor Summary | |
---|---|
Timezone(Integer hourOffset,
Integer minuteOffset)
Creates a timezone property. |
|
Timezone(Integer hourOffset,
Integer minuteOffset,
String text)
Creates a timezone property. |
|
Timezone(String text)
Creates a timezone property. |
|
Timezone(TimeZone timezone)
Creates a timezone property. |
|
Timezone(UtcOffset offset)
Creates a timezone property. |
|
Timezone(UtcOffset offset,
String text)
Creates a timezone property. |
Method Summary | |
---|---|
protected void |
_validate(List<Warning> warnings,
VCardVersion version,
VCard vcard)
Checks the property for data consistency problems or deviations from the spec. |
void |
addPid(int localId,
int clientPidMapRef)
Adds a PID value. |
String |
getAltId()
Gets the property's ALTID parameter. |
Integer |
getHourOffset()
Gets the hour component of the UTC offset. |
String |
getMediaType()
Gets the MEDIATYPE parameter. |
Integer |
getMinuteOffset()
Gets the minute component of the UTC offset. |
UtcOffset |
getOffset()
Gets the UTC offset. |
List<Integer[]> |
getPids()
Gets all PID values. |
Integer |
getPref()
Gets the preference value. |
String |
getText()
Gets the text portion of the timezone. |
String |
getType()
Gets the TYPE parameter. |
void |
removePids()
Removes all PID values. |
void |
setAltId(String altId)
Sets the property's ALTID parameter. |
void |
setMediaType(String mediaType)
Sets the MEDIATYPE parameter. |
void |
setOffset(int hourOffset,
int minuteOffset)
Sets the UTC offset. |
void |
setOffset(UtcOffset offset)
Sets the UTC offset. |
void |
setPref(Integer pref)
Sets the preference value. |
void |
setText(String text)
Sets the text portion of the timezone. |
void |
setType(String type)
Sets the TYPE parameter. |
TimeZone |
toTimeZone()
Creates a TimeZone representation of this class. |
Methods inherited from class ezvcard.property.VCardProperty |
---|
_supportedVersions, addParameter, compareTo, getGroup, getParameter, getParameters, getParameters, getSupportedVersions, removeParameter, setGroup, setParameter, setParameters, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timezone(String text)
text
- a free-form string representing the timezone, preferably a
timezone ID from the Olson
Database (e.g. "America/New_York")public Timezone(Integer hourOffset, Integer minuteOffset)
hourOffset
- the hour component of the UTC offset (e.g. -5)minuteOffset
- the minute component of the UTC offset (e.g. 0)public Timezone(UtcOffset offset)
offset
- the UTC offsetpublic Timezone(Integer hourOffset, Integer minuteOffset, String text)
hourOffset
- the hour component of the UTC offset (e.g. -5)minuteOffset
- the minute component of the UTC offset (e.g. 0)text
- a free-form string representing the timezone, preferably a
timezone ID from the Olson
Database (e.g. "America/New_York")public Timezone(UtcOffset offset, String text)
offset
- the UTC offsettext
- a free-form string representing the timezone, preferably a
timezone ID from the Olson
Database (e.g. "America/New_York")public Timezone(TimeZone timezone)
timezone
- the timezoneMethod Detail |
---|
public Integer getHourOffset()
public Integer getMinuteOffset()
public UtcOffset getOffset()
public void setOffset(int hourOffset, int minuteOffset)
hourOffset
- the hour offset (e.g. -5)minuteOffset
- the minute offset (e.g. 0)public void setOffset(UtcOffset offset)
offset
- the UTC offsetpublic String getText()
public void setText(String text)
text
- a free-form string representing the timezone, preferably a
timezone ID from the Olson
Database (e.g. "America/New_York")public TimeZone toTimeZone()
TimeZone
representation of this class.
TimeZone
object or null if this object contains no
offset datapublic String getType()
Supported versions: 4.0
public void setType(String type)
Supported versions: 4.0
type
- the TYPE value (this should be either "work" or "home") or
null to removepublic String getMediaType()
Supported versions: 4.0
public void setMediaType(String mediaType)
Supported versions: 4.0
mediaType
- the media type or null to removepublic List<Integer[]> getPids()
VCardProperty
Gets all PID values.
Supported versions: 4.0
VCardParameters.getPids()
public void addPid(int localId, int clientPidMapRef)
VCardProperty
Adds a PID value.
Supported versions: 4.0
localId
- the local IDclientPidMapRef
- the ID used to reference the property's globally
unique identifier in the CLIENTPIDMAP property.VCardParameters.addPid(int, int)
public void removePids()
VCardProperty
Removes all PID values.
Supported versions: 4.0
VCardParameters.removePids()
public Integer getPref()
VCardProperty
Gets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
Supported versions: 4.0
VCardParameters.getPref()
public void setPref(Integer pref)
VCardProperty
Sets the preference value. The lower the number, the more preferred this property instance is compared with other properties in the same vCard of the same type. If a property doesn't have a preference value, then it is considered the least preferred.
Supported versions: 4.0
pref
- the preference value or null to removeVCardParameters.setPref(java.lang.Integer)
public String getAltId()
HasAltId
Supported versions: 4.0
getAltId
in interface HasAltId
VCardParameters.getAltId()
public void setAltId(String altId)
HasAltId
Supported versions: 4.0
setAltId
in interface HasAltId
altId
- the ALTID or null to removeVCardParameters.setAltId(java.lang.String)
protected void _validate(List<Warning> warnings, VCardVersion version, VCard vcard)
VCardProperty
_validate
in class VCardProperty
warnings
- the list to add the warnings toversion
- the version to check the property againstvcard
- the vCard this property belongs to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |