com.ihr.xbrl.om.instance

## Class XBRLFactItem

- java.lang.Object
- - com.ihr.xbrl.om.XMLFragment
  - - com.ihr.xbrl.om.instance.XBRLFact
    - - com.ihr.xbrl.om.instance.XBRLFactItem

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, ObtainHistoryInterface, StoreHistoryInterface, XBRLRelationshipPoint, Thinable, XBRLValidation, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
  Direct Known Subclasses:
    XBRLFactNonNumeric, XBRLFactNumeric

      public abstract class XBRLFactItem
      extends XBRLFact
      implements HasAdditionalEqualityForReassignation

  This class represents the instantiation of an xbrli:item on an instance document.
  Author:
    Ignacio

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation

      `XBRLValidation.Direction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static javax.xml.namespace.QName` | `contextRef` The Constant contextRef.

    - ### Fields inherited from class com.ihr.xbrl.om.instance.XBRLFact

      `nil`

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cEqual(XBRLFactItem factTotal)` Evaluates if the two instantiation of the items are c-equal.
    `void` | `clear()` Eliminates all this fact content.
    `XBRLFactItem` | `clone()`
    `XBRLFactItem` | `clone(DTSContainer newDTS)` Clone current fact but in a new DTSContainer.
    `static XBRLFactItem` | `createItemInstance(XBRLFactsList container, XBRLContext ctx, XBRLItem xf, XBRLUnit unit)` creates an XBRLFactItem that can be either a XBRLFactNumeric or XBRLFactNonNumeric depending on the information provided in extra parameters.
    `static XBRLFact` | `createItemInstance(XBRLFactsList parent, XBRLItem xf, XBRLFactItem otherFact)` Creates the item instance.
    `static XBRLFactItem` | `createItemInstance(XBRLFactsList container, net.sf.saxon.s9api.XdmNode node, XMLFragment xf, int pos)` creates an XBRLFactItem that can be either a XBRLFactNumeric or XBRLFactNonNumeric depending on the data type (derivation included) of the concept definition.
    `boolean` | `equals(java.lang.Object obj)` Sets a new XPathFunctionResolver for this object.
    `org.jdom.Element` | `generateNode(boolean relativize, java.net.URI base)` Generates the XBRLFactItem jdom node.
    `java.util.Iterator<XBRLAttribute>` | `getAttributes()` Removes the contextRef attribute from the FactItem Parent iterators already removes the id attribute if any.
    `XBRLContext` | `getContext()` Access to the context object.
    `java.net.URI` | `getDocumentURI()` Access to the URI property of the instance document for this fact item.
    `XBRLItem` | `getElementDefinition()` Access to the surrounding item declaration for this item.
    `java.lang.String` | `getStringValue()` Returns a string representation of the value of this XMLFragment if value is null the function returns null.
    `int` | `hashCode()`
    `boolean` | `isBlank()` true if the fact item has no value assigned.
    `boolean` | `isDescendantOrSibling(XBRLFactItem otherFact)` Returns true if otherFact is a descendant or sibling of this fact.
    `abstract boolean` | `isDuplicate(XBRLFactItem tTarget, boolean reversePEqual)` For internal purposes only during the calculation of isDuplicate of tuple children elements.
    `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` | `setBlank(boolean value)` Sets the indicator that this fact item is blank.
    `void` | `setContext(XBRLContext c)` Sets the context of this fact.
    `void` | `setValue(net.sf.saxon.value.AtomicValue value)` Sets the value.
    `void` | `setValue(net.sf.saxon.s9api.XdmValue value)` Sets the value of this node.
    `abstract boolean` | `uEqual(XBRLFactItem toFact)` Check if two items are unit equal as defined in the XBRL 2.1 specification
    `abstract boolean` | `vEqual(XBRLFactItem toFact)` Check if two items are value equal as defined in the XBRL 2.1 specification

    - ### Methods inherited from class com.ihr.xbrl.om.instance.XBRLFact

      `addEvent, addEvent, addEvent, createItemOrTupleInstance, createItemOrTupleInstance, generateLocatorToNode, getElements, getFriendlyName, getFriendlyName, getHistory, getHistoryAsString, getInstance, getParent, getTaxonomy, getValidationReport, getXPathToRoot, invalidate, invalidate, isDuplicate, isNil, isOnValidation, pEqual, setId, setNil, setParent, validate`

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

      `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, 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, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticContext, getStaticNamespace, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, 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, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setVariablesDefined, size, thin, toString, valueEquals, xEqual`

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

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

- - ### Field Detail

    - #### contextRef

          public static final javax.xml.namespace.QName contextRef

      The Constant contextRef.

  - ### Method Detail

    - #### clear

          public void clear()
                     throws java.lang.Throwable

      Eliminates all this fact content.
      Overrides:
        `clear` in class `XBRLFact`
      Throws:
        `java.lang.Throwable` - the throwable

    - #### clone

          public XBRLFactItem clone()

      Overrides:
        `clone` in class `XBRLFact`

    - #### clone

          public XBRLFactItem clone(DTSContainer newDTS)

      Description copied from class: `XBRLFact`
      Clone current fact but in a new DTSContainer.
      Overrides:
        `clone` in class `XBRLFact`
      Parameters:
        `newDTS` - the new dts
      Returns:
        cloned XBRLFact

    - #### createItemInstance

          public static XBRLFactItem createItemInstance(XBRLFactsList container,
                                        net.sf.saxon.s9api.XdmNode node,
                                        XMLFragment xf,
                                        int pos)
                                                 throws XBRLValidationException

      creates an XBRLFactItem that can be either a XBRLFactNumeric or XBRLFactNonNumeric depending on the data type (derivation included) of the concept definition.
      Parameters:
        `container` - XBRLFactsContainer where the new fact will be added
        `node` - NodeInfo to process while creating the fact item
        `xf` - XBRLItem concept definition
        `pos` - the pos
      Returns:
        com.ihr.xbrl.om.instance.XBRLFactItem
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### createItemInstance

          public static XBRLFactItem createItemInstance(XBRLFactsList container,
                                        XBRLContext ctx,
                                        XBRLItem xf,
                                        XBRLUnit unit)

      creates an XBRLFactItem that can be either a XBRLFactNumeric or XBRLFactNonNumeric depending on the information provided in extra parameters.
      Parameters:
        `container` - XBRLFactsList container of the new fact
        `ctx` - XBRLContext for the new fact
        `xf` - XBRLItem definition
        `unit` - XBRLUnit may be null is item is string item type
      Returns:
        a new XBRLFactItem

    - #### createItemInstance

          public static XBRLFact createItemInstance(XBRLFactsList parent,
                                    XBRLItem xf,
                                    XBRLFactItem otherFact)

      Creates the item instance.
      Parameters:
        `parent` - the parent
        `xf` - the xf
        `otherFact` - the other fact
      Returns:
        XBRLFact

    - #### getDocumentURI

          public java.net.URI getDocumentURI()

      Access to the URI property of the instance document for this fact item.
      Returns:
        URI from the instance or null if the instance contains no URI.

    - #### getStringValue

          public java.lang.String getStringValue()
                                          throws XBRLSerializationException

      Description copied from class: `XMLFragment`
      Returns a string representation of the value of this XMLFragment if value is null the function returns null.
      Overrides:
        `getStringValue` in class `XMLFragment`
      Returns:
        String
      Throws:
        `XBRLSerializationException` - the XBRL serialization exception

    - #### getContext

          public XBRLContext getContext()

      Access to the context object.
      Returns:
        the XBRLContext if found. null if no context is set

    - #### setContext

          public void setContext(XBRLContext c)

      Sets the context of this fact.
      Parameters:
        `c` - new XBRLContext

    - #### getAttributes

          public java.util.Iterator<XBRLAttribute> getAttributes()

      Removes the contextRef attribute from the FactItem

      Parent iterators already removes the id attribute if any.

      Overrides:
        `getAttributes` in class `XMLFragment`
      Returns:
        the attributes
      See Also:
        `XMLFragment.getAttributes()`

    - #### getElementDefinition

          public XBRLItem getElementDefinition()

      Access to the surrounding item declaration for this item.
      Overrides:
        `getElementDefinition` in class `XBRLFact`
      Returns:
        XBRLItem or null if no item is found (very rare case)

    - #### cEqual

          public boolean cEqual(XBRLFactItem factTotal)

      Evaluates if the two instantiation of the items are c-equal.
      Parameters:
        `factTotal` - XBRLFactItem other fact
      Returns:
        boolean

    - #### vEqual

          public abstract boolean vEqual(XBRLFactItem toFact)

      Check if two items are value equal as defined in the XBRL 2.1 specification
      Parameters:
        `toFact` - the other XBRLFactItem
      Returns:
        boolean

    - #### uEqual

          public abstract boolean uEqual(XBRLFactItem toFact)

      Check if two items are unit equal as defined in the XBRL 2.1 specification
      Parameters:
        `toFact` - the other XBRLFactItem
      Returns:
        boolean

    - #### isBlank

          public boolean isBlank()

      true if the fact item has no value assigned. No value assigned is different from being null
      Returns:
        boolean value

    - #### setBlank

          public void setBlank(boolean value)

      Sets the indicator that this fact item is blank.
      Parameters:
        `value` - the new blank

    - #### setValue

          public void setValue(net.sf.saxon.value.AtomicValue value)

      Description copied from class: `XMLFragment`
      Sets the value.
      Overrides:
        `setValue` in class `XBRLFact`
      Parameters:
        `value` - the new value

    - #### setValue

          public void setValue(net.sf.saxon.s9api.XdmValue value)

      Description copied from class: `XMLFragment`
      Sets the value of this node.
      Overrides:
        `setValue` in class `XBRLFact`
      Parameters:
        `value` - the new value

    - #### isDescendantOrSibling

          public boolean isDescendantOrSibling(XBRLFactItem otherFact)

      Returns true if otherFact is a descendant or sibling of this fact.
      Parameters:
        `otherFact` - XBRLFactItem
      Returns:
        boolean

    - #### generateNode

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

      Generates the XBRLFactItem jdom node. If neccesary, generates the footnotes defined for this node.
      Overrides:
        `generateNode` in class `XBRLFact`
      Parameters:
        `relativize` - the relativize
        `base` - the base
      Returns:
        the element
      Throws:
        `XBRLSerializationException` - the XBRL serialization exception

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `XBRLFact`

    - #### s_equal2

          public boolean s_equal2(java.lang.Object other)

      Description copied from class: `XMLFragment`
      Resolves s_equal2 comparison of this node against the other node.
      Overrides:
        `s_equal2` in class `XMLFragment`
      Parameters:
        `other` - The other node (preferably an XMLFragment) that contains a non null NodeInfo document.
      Returns:
        boolean

    - #### equals

          public boolean equals(java.lang.Object obj)

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

    - #### isDuplicate

          public abstract boolean isDuplicate(XBRLFactItem tTarget,
                            boolean reversePEqual)

      For internal purposes only during the calculation of isDuplicate of tuple children elements.
      Parameters:
        `tTarget` - the t target
        `reversePEqual` - the reverse p equal
      Returns:
        boolean value

    - #### resolve_equal2

          public boolean resolve_equal2(net.sf.saxon.s9api.XdmNode otherXdmNode)

      Description copied from interface: `HasAdditionalEqualityForReassignation`
      resolves content that is added by this XMLFragment during XMLNode serialization and may not be available to the lower levels in the hierarchy.
      Specified by:
        `resolve_equal2` in interface `HasAdditionalEqualityForReassignation`
      Overrides:
        `resolve_equal2` in class `XMLFragment`
      Parameters:
        `otherXdmNode` - the other xdm node
      Returns:
        true, if successful