public class XBRLPeriod extends XMLFragment implements java.lang.Cloneable, HasAdditionalEqualityForReassignation
| Modifier and Type | Field and Description |
|---|---|
static int |
DATE_END
Constant to refer to the END date or datetime of this period.
|
static int |
DATE_INSTANT
Constant to refer to the INSTANT date or datetime of this period.
|
static int |
DATE_START
Constant to refer to the START date or datetime of this period.
|
static javax.xml.namespace.QName |
periodNode
Constant xbrli:period used during serialization of periods.
|
static com.ihr.xbrl.om.instance.XBRLPeriod.TimeSorter |
TimeSorterInstance
Sorts Periods so they are ordered according to the following criteria:
(a) duration periods are ordered according to the date in the middle of the period.
|
CONCEPT_LABEL, CONCEPT_QNAME, EASY_TO_READ, ELEMENT_LABEL, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, HIDE_COMMON_ACCURACY, idQName, NO_POSITION, OrderComparator, OrderComparator2, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER| Constructor and Description |
|---|
XBRLPeriod(DTSContainer dts)
Creates a FOREVER period.
|
XBRLPeriod(DTSContainer dts,
java.util.GregorianCalendar instant,
boolean bHasTimeZone,
boolean bHasTime)
Creates a INSTANT period with the instant date
The date value will be set to the Gregorian Calender used in the parameter.
|
XBRLPeriod(DTSContainer dts,
java.util.GregorianCalendar start,
java.util.GregorianCalendar end,
boolean bHasTimeZone,
boolean bHasTime)
Instantiates a new XBRL period.
|
XBRLPeriod(DTSContainer dts,
java.lang.String instantDate)
Creates a INSTANT period with the instantDate
Note: As dates are in ISO 8601 format, the date representation "2007-08-31" is
assumed to be in the NO_TIMEZONE time zone.
|
XBRLPeriod(DTSContainer dts,
java.lang.String startDate,
java.lang.String endDate)
Creates a DURATION period with the startDate and endDate
Note: As dates are in ISO 8601 format, the date representation "2007-08-31" is
assumed to be in the NO_TIMEZONE time zone.
|
XBRLPeriod(DTSContainer dts,
net.sf.saxon.s9api.XdmNode node)
Creates a XBRLPeriod reading the content of the XdmNode node supplied as a parameter.
|
XBRLPeriod(XBRLPeriod other)
Creates an new period as a copy of the current period.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.GregorianCalendar |
adjust24h(java.util.GregorianCalendar calendar,
boolean sign)
Adjust24h.
|
void |
clear()
Frees-up used memory
This method should not be invoqued on live objects in the DTS.
|
XBRLPeriod |
clone() |
XBRLPeriod |
clone(DTSContainer newDTS)
Clone.
|
boolean |
equals(java.lang.Object other)
Sets a new XPathFunctionResolver for this object.
|
org.jdom.Element |
generateNode(boolean relativize,
java.net.URI base)
Serializes to a jdom Element the representation of the properties of this Information Item
This method should be called from classes derived from this class
|
java.util.GregorianCalendar |
getComparableDate()
Gets the comparable date.
|
java.lang.String |
getDate(int type)
String representation of the date in the period. adjusted according to XBRL specification rules.
|
java.util.Iterator<XMLFragment> |
getElements()
For complex type resources this returns an iterator with all children XML fragments
This method may be overwriten by other classes in the hierarchy.
|
java.lang.String |
getFriendlyName()
Returns a string description that represents the element content in a form
that users can understand.
|
java.lang.String |
getFriendlyName(int modifiers,
LabelsProvider lp)
Returns a string description that represents the element content in a form
that users can understand.
|
java.util.GregorianCalendar |
getGregorianCalendarDate(int type)
Returns the value of the date for the type requested.
|
java.lang.String |
getLocalizedPeriodType()
Returns a localized string representing the period type. this is, in English
"instant" or "duration".
|
static java.lang.String |
getLocalizedPeriodType(XBRLItem.PeriodType periodType)
Returns a localized string representing the period type. this is, in English
"instant" or "duration".
|
XBRLItem.PeriodType |
getPeriodType()
Returns XBRLItem.DURATION or XBRLItem.INSTANT depending on the context period information.
|
java.lang.String |
getRawDate(int type)
String representation of the date in the period.
|
java.util.Date |
getRawDateUtil(int code)
Returns the raw date (the one specified by syntax) in the context.
|
java.util.GregorianCalendar |
getRawGregorianCalendarDate(int type)
Returns the value of the date for the type requested.
|
int |
hashCode() |
boolean |
isDuration()
Checks if is duration.
|
boolean |
isForever()
Checks if is forever.
|
boolean |
isInstant()
Checks if is instant.
|
static java.lang.String |
iso8601(java.util.GregorianCalendar c,
boolean hasTimezone,
boolean hasTime)
Returns a string representation in iso8601 standard with the value of
variable c
yyyy-MM-dd'T'HH:mm:ss.SSSZ is the complete patters that can be used
some parts of this pattern can be omited according to the values
of hasTimezone and hasTime below.
|
static java.util.GregorianCalendar |
iso8601(java.lang.String value,
boolean bAdd24h)
Converts a string of the format yyyy-MM-dd to the apropriate
GregorianCalendar object.
|
boolean |
resolve_equal2(net.sf.saxon.s9api.XdmNode otherXdmNode)
resolves content that is added by this XMLFragment during XMLNode serialization
and may not be available to the lower levels in the hierarchy.
|
boolean |
s_equal2(java.lang.Object other)
Resolves s_equal2 comparison of this node against the other node.
|
void |
setDate(int type,
java.lang.String strDate)
Sets the value of the specified field.
|
java.lang.String |
toString()
Returns the XML representation of this object as an String.
|
XBRLValidationReport |
validate()
Produces a XBRLValidationReport object for this period object.
|
addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAllAttributes, getAttribute, getAttributeBooleanValue, getAttributeQNameValue, getAttributes, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElementsHashCode, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getGenericLabelText, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParent, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticContext, getStaticNamespace, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, isXdmDocumentAttached, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setId, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setValue, setValue, setVariablesDefined, size, thin, valueEquals, xEqualpublic static com.ihr.xbrl.om.instance.XBRLPeriod.TimeSorter TimeSorterInstance
(a) duration periods are ordered according to the date in the middle of the period.
(b) instant periods are ordered according to the date represented.
(c) Forever periods are duration periods. they are equal to forever periods or always start earlier that any other duration period. Forever period and instant period comparison result in -1.
(d) Instant and Duration periods are ordered according to a date that is in the middle of the period
public static final javax.xml.namespace.QName periodNode
public static final int DATE_INSTANT
public static final int DATE_START
public static final int DATE_END
public XBRLPeriod(DTSContainer dts, net.sf.saxon.s9api.XdmNode node)
dts - DTSContainer for this new periodnode - XdmNode XML node s9api where data will be read frompublic XBRLPeriod(DTSContainer dts)
dts - DTSContainerpublic XBRLPeriod(DTSContainer dts, java.lang.String startDate, java.lang.String endDate)
dts - - DTSContainerstartDate - - Date string in ISO 8601 formatendDate - - Date string in ISO 8601 formatpublic XBRLPeriod(DTSContainer dts, java.lang.String instantDate)
dts - - DTSContainerinstantDate - - Date string in ISO 8601 formatpublic XBRLPeriod(DTSContainer dts, java.util.GregorianCalendar instant, boolean bHasTimeZone, boolean bHasTime)
dts - - DTSContainerinstant - - Gregorian CalendarbHasTimeZone - the b has time zonebHasTime - the b has timepublic XBRLPeriod(DTSContainer dts, java.util.GregorianCalendar start, java.util.GregorianCalendar end, boolean bHasTimeZone, boolean bHasTime)
dts - the dtsstart - the startend - the endbHasTimeZone - the b has time zonebHasTime - the b has timepublic XBRLPeriod(XBRLPeriod other)
other - XBRLPeriodpublic java.util.GregorianCalendar getComparableDate()
public void clear()
throws java.lang.Throwable
XMLFragmentThis method should not be invoqued on live objects in the DTS. It is automatically invoqued by the API when an object is no longer used and referenced by other objects. It is save not to call it directly.
clear in class XMLFragmentjava.lang.Throwable - the throwablepublic XBRLPeriod clone()
clone in class XMLFragmentpublic XBRLPeriod clone(DTSContainer newDTS)
XMLFragmentclone in class XMLFragmentnewDTS - the new dtspublic XBRLItem.PeriodType getPeriodType()
public java.lang.String getFriendlyName()
XMLFragmentRemarks, this method may return very long names not suitable for user interface
getFriendlyName in class XMLFragmentpublic java.lang.String getFriendlyName(int modifiers,
LabelsProvider lp)
XMLFragmentThis function accepts flags that are defined as constants in XMLFragment in order to modify the output.
getFriendlyName in class XMLFragmentmodifiers - integerlp - the lppublic boolean isInstant()
public boolean isDuration()
public boolean isForever()
public java.lang.String getDate(int type)
type - code indicating what to obtain. DATE_INSTANT, DATE_START or DATE_ENDpublic java.lang.String getRawDate(int type)
type - code indicating what to obtain. DATE_INSTANT, DATE_START or DATE_ENDpublic java.util.GregorianCalendar getGregorianCalendarDate(int type)
type - one of the constants belowpublic java.util.GregorianCalendar getRawGregorianCalendarDate(int type)
type - one of the constants belowpublic static java.util.GregorianCalendar adjust24h(java.util.GregorianCalendar calendar,
boolean sign)
calendar - the calendarsign - boolean (true) to add 24 hours (false) to substract 24 hourspublic XBRLValidationReport validate()
public boolean equals(java.lang.Object other)
XMLFragmentequals in class XMLFragmentother - the otherpublic boolean s_equal2(java.lang.Object other)
XMLFragments_equal2 in class XMLFragmentother - The other node (preferably an XMLFragment) that contains a non null NodeInfo document.public int hashCode()
hashCode in class XMLFragmentpublic org.jdom.Element generateNode(boolean relativize,
java.net.URI base)
throws XBRLSerializationException
XMLFragmentgenerateNode in class XMLFragmentrelativize - boolean indicating if URIs should be relativized to the base URI (see next argument)base - the URI to which some attributes of this object should be relatividedXBRLSerializationException - the XBRL serialization exceptionpublic static java.lang.String iso8601(java.util.GregorianCalendar c,
boolean hasTimezone,
boolean hasTime)
c - GregorianCalendarhasTimezone - boolean value, true means c has time zone informationhasTime - boolean value, true means c has time informationpublic static java.util.GregorianCalendar iso8601(java.lang.String value,
boolean bAdd24h)
value - string in the format yyyy-MM-ddbAdd24h - for period end dates this must be set to truepublic void setDate(int type,
java.lang.String strDate)
throws XBRLValidationException
type - this is the field, DATE_END, DATE_INSTANT, DATE_STARTstrDate - iso8601 date stringXBRLValidationException - the XBRL validation exceptionpublic java.util.Date getRawDateUtil(int code)
code - this is the field, DATE_END, DATE_INSTANT, DATE_STARTpublic java.lang.String toString()
XMLFragmenttoString in class XMLFragmentpublic java.util.Iterator<XMLFragment> getElements()
XMLFragmentgetElements in class XMLFragmentpublic java.lang.String getLocalizedPeriodType()
public static java.lang.String getLocalizedPeriodType(XBRLItem.PeriodType periodType)
periodType - constant indicating XBRLItem.INSTANT or XBRLItem.DURATIONpublic boolean resolve_equal2(net.sf.saxon.s9api.XdmNode otherXdmNode)
HasAdditionalEqualityForReassignationresolve_equal2 in interface HasAdditionalEqualityForReassignationresolve_equal2 in class XMLFragmentotherXdmNode - the other xdm node