com.ihr.xbrl.mapper.instance

## Class MapperPeriodBase

- java.lang.Object
- - com.ihr.xbrl.om.XMLFragment
  - - com.ihr.xbrl.mapper.instance.MapperPeriodBase

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, MapperPeriod, XBRLRelationshipPoint, Thinable, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
  Direct Known Subclasses:
    MapperPeriod2, MapperPeriod3

      public abstract class MapperPeriodBase
      extends XMLFragment
      implements MapperPeriod

  The Class MapperPeriodBase.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    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.

    - ### Fields inherited from class com.ihr.xbrl.om.XMLFragment

      `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 Summary

    Constructors
    Constructor and Description
    `MapperPeriodBase(DTSContainer dts)` Instantiates a new mapper period base.
    `MapperPeriodBase(DTSContainer dts, net.sf.saxon.s9api.XdmNode node)` Instantiates a new mapper period base.
    `MapperPeriodBase(MapperPeriodBase other)` Creates an new period as a copy of the current period.
    `MapperPeriodBase(XBRLPeriod period)` Instantiates a new mapper period base.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract MapperPeriodBase` | `clone()` 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.lang.String` | `getDate(int type, boolean operate)` 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.util.GregorianCalendar` | `getGregorianCalendarDate(int type)` Returns the value of the date for the type requested.
    `XBRLItem.PeriodType` | `getPeriodType()` Returns XBRLItem.DURATION or XBRLItem.INSTANT depending on the context period information.
    `java.lang.String` | `getRawDate(int type, boolean operate)` 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.
    `XBRLPeriod` | `getXBRLPeriod()` Gets the XBRL period.
    `int` | `hashCode()` Hash code.
    `boolean` | `isDuration()` Checks if is duration.
    `boolean` | `isForever()` Checks if is forever.
    `boolean` | `isInstant()` Checks if is instant.
    `boolean` | `isMacroPeriod()` Returns true only if the period content is a string of text that can be evaluated as a macro.
    `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.

    - ### Methods inherited from class com.ihr.xbrl.om.XMLFragment

      `addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clear, clone, 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, getFriendlyName, getFriendlyName, 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, resolve_equal2, resolveHRef, resolveHRef, s_equal2, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setId, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setValue, setValue, setVariablesDefined, size, thin, valueEquals, xEqual`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### periodNode

          public static final javax.xml.namespace.QName periodNode

      Constant xbrli:period used during serialization of periods.

    - #### DATE_INSTANT

          public static final int DATE_INSTANT

      Constant to refer to the INSTANT date or datetime of this period.
      See Also:
        Constant Field Values

    - #### DATE_START

          public static final int DATE_START

      Constant to refer to the START date or datetime of this period.
      See Also:
        Constant Field Values

    - #### DATE_END

          public static final int DATE_END

      Constant to refer to the END date or datetime of this period.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MapperPeriodBase

          public MapperPeriodBase(DTSContainer dts)

      Instantiates a new mapper period base.
      Parameters:
        `dts` - the dts

    - #### MapperPeriodBase

          public MapperPeriodBase(DTSContainer dts,
                          net.sf.saxon.s9api.XdmNode node)

      Instantiates a new mapper period base.
      Parameters:
        `dts` - the dts
        `node` - the node

    - #### MapperPeriodBase

          public MapperPeriodBase(MapperPeriodBase other)

      Creates an new period as a copy of the current period. This is the constructor used by clone() method but make public for convenience
      Parameters:
        `other` - XBRLPeriod

    - #### MapperPeriodBase

          public MapperPeriodBase(XBRLPeriod period)

      Instantiates a new mapper period base.
      Parameters:
        `period` - the period

  - ### Method Detail

    - #### clone

          public abstract MapperPeriodBase clone()

      Description copied from interface: `MapperPeriod`
      Clone.
      Specified by:
        `clone` in interface `MapperPeriod`
      Overrides:
        `clone` in class `XMLFragment`
      Returns:
        the mapper period

    - #### generateNode

          public org.jdom.Element generateNode(boolean relativize,
                                      java.net.URI base)
                                        throws XBRLSerializationException

      Description copied from class: `XMLFragment`
      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
      Specified by:
        `generateNode` in interface `MapperPeriod`
      Overrides:
        `generateNode` in class `XMLFragment`
      Parameters:
        `relativize` - 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 relativided
      Returns:
        a clone of the surrounding jdom Element so it can be incorporated into multiple trees
      Throws:
        `XBRLSerializationException` - the XBRL serialization exception

    - #### getPeriodType

          public XBRLItem.PeriodType getPeriodType()

      Returns XBRLItem.DURATION or XBRLItem.INSTANT depending on the context period information. Forever periods are considered DURATION.
      Specified by:
        `getPeriodType` in interface `MapperPeriod`
      Returns:
        int

    - #### isInstant

          public boolean isInstant()

      Checks if is instant.
      Specified by:
        `isInstant` in interface `MapperPeriod`
      Returns:
        true if this period is of the XBRL instant type

    - #### isDuration

          public boolean isDuration()

      Checks if is duration.
      Specified by:
        `isDuration` in interface `MapperPeriod`
      Returns:
        true if this period is of the XBRL duration type. Forever periods are duration

    - #### isMacroPeriod

          public boolean isMacroPeriod()

      Returns true only if the period content is a string of text that can be evaluated as a macro.
      Specified by:
        `isMacroPeriod` in interface `MapperPeriod`
      Returns:
        boolean

    - #### isForever

          public boolean isForever()

      Checks if is forever.
      Specified by:
        `isForever` in interface `MapperPeriod`
      Returns:
        true if this period is forever

    - #### getDate

          public java.lang.String getDate(int type,
                                 boolean operate)

      String representation of the date in the period. adjusted according to XBRL specification rules. That is, adding 24 hours to period end and instant dates and keeping the date on period start dates.
      Specified by:
        `getDate` in interface `MapperPeriod`
      Parameters:
        `type` - code indicating what to obtain. DATE_INSTANT, DATE_START or DATE_END
        `operate` - the operate
      Returns:
        String

    - #### getRawDate

          public java.lang.String getRawDate(int type,
                                    boolean operate)

      String representation of the date in the period. NOT adjusted according to XBRL specification rules. That is, not adding 24 hours to any date
      Specified by:
        `getRawDate` in interface `MapperPeriod`
      Parameters:
        `type` - code indicating what to obtain. DATE_INSTANT, DATE_START or DATE_END
        `operate` - the operate
      Returns:
        String

    - #### getGregorianCalendarDate

          public java.util.GregorianCalendar getGregorianCalendarDate(int type)

      Returns the value of the date for the type requested. returned values are adjusted according to XBRL specification rules Valid types are: XBRLPeriod.DATE_END XBRLPeriod.DATE_START XBRLPeriod.DATE_INSTANT
      Specified by:
        `getGregorianCalendarDate` in interface `MapperPeriod`
      Parameters:
        `type` - one of the constants below
      Returns:
        a GregorianCalendar

    - #### getRawGregorianCalendarDate

          public java.util.GregorianCalendar getRawGregorianCalendarDate(int type)

      Returns the value of the date for the type requested. NOT adjusted to XBRL interpretation. returned values are NOT adjusted according to XBRL specification rules Valid types are: XBRLPeriod.DATE_END XBRLPeriod.DATE_START XBRLPeriod.DATE_INSTANT
      Specified by:
        `getRawGregorianCalendarDate` in interface `MapperPeriod`
      Parameters:
        `type` - one of the constants below
      Returns:
        a GregorianCalendar

    - #### setDate

          public void setDate(int type,
                     java.lang.String strDate)
                       throws XBRLValidationException

      Sets the value of the specified field.
      Specified by:
        `setDate` in interface `MapperPeriod`
      Parameters:
        `type` - this is the field, DATE_END, DATE_INSTANT, DATE_START
        `strDate` - iso8601 date string
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getRawDateUtil

          public java.util.Date getRawDateUtil(int code)

      Returns the raw date (the one specified by syntax) in the context. "raw" means no +1PD will be assumed for instance dates or endDate dates The return value is a Date in this case.
      Specified by:
        `getRawDateUtil` in interface `MapperPeriod`
      Parameters:
        `code` - this is the field, DATE_END, DATE_INSTANT, DATE_START
      Returns:
        a java.util.Date

    - #### toString

          public java.lang.String toString()

      Description copied from class: `XMLFragment`
      Returns the XML representation of this object as an String.
      Specified by:
        `toString` in interface `MapperPeriod`
      Overrides:
        `toString` in class `XMLFragment`
      Returns:
        the string

    - #### getElements

          public java.util.Iterator<XMLFragment> getElements()

      Description copied from class: `XMLFragment`
      For complex type resources this returns an iterator with all children XML fragments This method may be overwriten by other classes in the hierarchy.
      Specified by:
        `getElements` in interface `MapperPeriod`
      Overrides:
        `getElements` in class `XMLFragment`
      Returns:
        Iterator

    - #### getXBRLPeriod

          public XBRLPeriod getXBRLPeriod()

      Gets the XBRL period.
      Specified by:
        `getXBRLPeriod` in interface `MapperPeriod`
      Returns:
        XBRLPeriod

    - #### equals

          public boolean equals(java.lang.Object other)

      Description copied from class: `XMLFragment`
      Sets a new XPathFunctionResolver for this object.
      Specified by:
        `equals` in interface `MapperPeriod`
      Overrides:
        `equals` in class `XMLFragment`
      Parameters:
        `other` - the other
      Returns:
        true, if successful

    - #### hashCode

          public int hashCode()

      Description copied from interface: `MapperPeriod`
      Hash code.
      Specified by:
        `hashCode` in interface `MapperPeriod`
      Overrides:
        `hashCode` in class `XMLFragment`
      Returns:
        the int