com.ihr.xbrl.om.instance

## Class XBRLFactTuple

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

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, ObtainHistoryInterface, StoreHistoryInterface, XBRLRelationshipPoint, XBRLFactsList, Thinable, XBRLValidation, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext

      public class XBRLFactTuple
      extends XBRLFact
      implements XBRLFactsList

  The Class XBRLFactTuple.

- - ### Nested Class Summary

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

      `XBRLValidation.Direction`

  - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBRLFactTuple(XBRLFactsList parent, XBRLTuple tupleDecl)` Creates a new tuple.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(int index, XBRLFact fact)` Resets the nillable status to false automatically.
    `boolean` | `add(XBRLFact fact)` Resets the nillable status to false automatically.
    `void` | `addOrForwardItem(XBRLFactItem item)` Called internally to register new facts in the instance document.
    `void` | `clear()` Eliminates all this fact content.
    `XBRLFactTuple` | `clone()`
    `XBRLFactTuple` | `clone(DTSContainer newDTS)` Clone current fact but in a new DTSContainer.
    `boolean` | `equals(java.lang.Object obj)` Sets a new XPathFunctionResolver for this object.
    `void` | `forwardItem(XBRLFactItem item)` Forward item.
    `org.jdom.Element` | `generateNode(boolean relativize, java.net.URI base)` Generates the XBRLFact jdom node.
    `XBRLFact` | `get(int index)` Returns the element at the selected index position.
    `XBRLTuple` | `getElementDefinition()` Access to the element definition behind this fact.
    `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)` Gets the friendly name.
    `java.util.Iterator<java.util.Vector<XBRLFactItem>>` | `getItems()` Iterator over the items on this facts container.
    `java.util.Iterator<XBRLFactItem>` | `getItems(XBRLItem itemFrom)` Iterator over fact items that are instances of the XBRLItem received as a parameter.
    `java.util.Iterator<XBRLFactItem>` | `getItemsSg(XBRLItem itemFrom)` Iterator over fact items that are instances of the XBRLItem received as a parameter of in the substitution group of that item.
    `int` | `getNumberOfTuples()` Calculates and returns the number of tuples children of this facts container .
    `java.util.Iterator<java.util.Vector<XBRLFactTuple>>` | `getTuples()` Iterator over the tuples on this facts container.
    `java.util.Iterator<XBRLFactTuple>` | `getTuples(XBRLTuple tupleFrom)` Iterator over fact tuples that are instances of the XBRLTuple received as a parameter.
    `java.util.Iterator<XBRLFactTuple>` | `getTuplesSg(XBRLTuple tupleFrom)` Iterator over fact tuples that are instances of the XBRLTuple received as a parameter of in the substitution group of that tuple.
    `net.sf.saxon.s9api.XdmValue` | `getValue()` Returns the value of this node.
    `int` | `hashCode()` This is from the Object interface and must be implemented by sub classes in order to be able to provide hashCodes.
    `int` | `indexOf(XBRLFact fact)` Returns the index position of a fact within this list.
    `int` | `indexOf(XBRLFact fact, int index)` Returns the index position of a fact within this list starting at the position indicated by the index parameter.
    `boolean` | `isDuplicate(XBRLFact otherFact)` Check if two items are duplicates as defined in the XBRL 2.1 specification
    `boolean` | `isNil()` Return true if the fact is nil it MUST contain a @xsi:nil attribute with value = true.
    `java.util.Iterator<XBRLFact>` | `iterator()` Iterator.
    `boolean` | `remove(XBRLFact fact)` Removes a fact from the facts container.
    `boolean` | `s_equal2(java.lang.Object other)` Resolves s_equal2 comparison of this node against the other node.
    `void` | `setNil(boolean newValue)` This method clears the tuple content if the value if set from false to true.
    `void` | `setParent(XBRLFactsList parent)` Sets the parent of this XBRLFact to be the XBRLFactsList object used as a parameter.
    `int` | `size()` For complex type resources this returns the number of children elements that all are XML fragments This method may be overwriten by other classes in the hierarchy.

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

      `addEvent, addEvent, addEvent, createItemOrTupleInstance, createItemOrTupleInstance, generateLocatorToNode, getElements, getHistory, getHistoryAsString, getInstance, getParent, getTaxonomy, getValidationReport, getXPathToRoot, invalidate, invalidate, isOnValidation, pEqual, setId, setValue, setValue, 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, 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, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, 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, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setVariablesDefined, thin, toString, valueEquals, xEqual`

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

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

    - ### Methods inherited from interface com.ihr.xbrl.om.instance.XBRLFactsList

      `evaluateList, getContainer, getDocument, getInstance, getParent, getXPathToRoot, isXdmDocumentAttached`

    - ### Methods inherited from interface com.ihr.xbrl.om.XMLHasParent

      `addXMLChild, getBase, removeXMLChild, setParent`

- - ### Constructor Detail

    - #### XBRLFactTuple

          public XBRLFactTuple(XBRLFactsList parent,
                       XBRLTuple tupleDecl)

      Creates a new tuple.
      Parameters:
        `parent` - the parent
        `tupleDecl` - the tuple decl

  - ### Method Detail

    - #### getElementDefinition

          public XBRLTuple getElementDefinition()

      Description copied from class: `XBRLFact`
      Access to the element definition behind this fact.
      Overrides:
        `getElementDefinition` in class `XBRLFact`
      Returns:
        XMLElementDefinition

    - #### clone

          public XBRLFactTuple clone()

      Overrides:
        `clone` in class `XBRLFact`

    - #### clone

          public XBRLFactTuple 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

    - #### isNil

          public boolean isNil()

      Description copied from class: `XBRLFact`
      Return true if the fact is nil it MUST contain a @xsi:nil attribute with value = true.
      Overrides:
        `isNil` in class `XBRLFact`
      Returns:
        boolean

    - #### setNil

          public void setNil(boolean newValue)

      This method clears the tuple content if the value if set from false to true. Then calls the super implementation in XBRLFact.
      Overrides:
        `setNil` in class `XBRLFact`
      Parameters:
        `newValue` - the new nil

    - #### forwardItem

          public void forwardItem(XBRLFactItem item)

      Forward item.
      Parameters:
        `item` - the item

    - #### getValue

          public net.sf.saxon.s9api.XdmValue getValue()

      Description copied from class: `XMLFragment`
      Returns the value of this node. If the value has been set to a jdom node then this function returns null If getDocument() is null then this function returns an empty sequence If getDocument() is not null this function tries to return an atomic value this function should be overridden by objects in this API
      Overrides:
        `getValue` in class `XMLFragment`
      Returns:
        a net.sf.saxon.s9api.XdmValue

    - #### generateNode

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

      Description copied from class: `XBRLFact`
      Generates the XBRLFact jdom node. adds the xsi:nil attribute if required
      Overrides:
        `generateNode` in class `XBRLFact`
      Parameters:
        `relativize` - the relativize
        `base` - the base
      Returns:
        the element
      Throws:
        `XBRLSerializationException` - the XBRL serialization exception

    - #### add

          public boolean add(XBRLFact fact)

      Resets the nillable status to false automatically. Then calls the super implementation
      Specified by:
        `add` in interface `XBRLFactsList`
      Parameters:
        `fact` - the fact
      Returns:
        true, if successful

    - #### add

          public void add(int index,
                 XBRLFact fact)

      Resets the nillable status to false automatically. Then calls the super implementation
      Specified by:
        `add` in interface `XBRLFactsList`
      Parameters:
        `index` - the index
        `fact` - the fact

    - #### getItems

          public java.util.Iterator<java.util.Vector<XBRLFactItem>> getItems()

      Description copied from interface: `XBRLFactsList`
      Iterator over the items on this facts container.
      Specified by:
        `getItems` in interface `XBRLFactsList`
      Returns:
        Iterator<Vector<XBRLFactItem>>

    - #### getItems

          public java.util.Iterator<XBRLFactItem> getItems(XBRLItem itemFrom)

      Description copied from interface: `XBRLFactsList`
      Iterator over fact items that are instances of the XBRLItem received as a parameter.
      Specified by:
        `getItems` in interface `XBRLFactsList`
      Parameters:
        `itemFrom` - XBRLItem
      Returns:
        Iterator<XBRLFactItem>

    - #### getTuples

          public java.util.Iterator<java.util.Vector<XBRLFactTuple>> getTuples()

      Description copied from interface: `XBRLFactsList`
      Iterator over the tuples on this facts container.
      Specified by:
        `getTuples` in interface `XBRLFactsList`
      Returns:
        Iterator<Vector<XBRLFactTuple>>

    - #### getTuples

          public java.util.Iterator<XBRLFactTuple> getTuples(XBRLTuple tupleFrom)

      Description copied from interface: `XBRLFactsList`
      Iterator over fact tuples that are instances of the XBRLTuple received as a parameter.
      Specified by:
        `getTuples` in interface `XBRLFactsList`
      Parameters:
        `tupleFrom` - XBRLTuple
      Returns:
        Iterator<XBRLFactTuple>

    - #### getItemsSg

          public java.util.Iterator<XBRLFactItem> getItemsSg(XBRLItem itemFrom)

      Description copied from interface: `XBRLFactsList`
      Iterator over fact items that are instances of the XBRLItem received as a parameter of in the substitution group of that item.
      Specified by:
        `getItemsSg` in interface `XBRLFactsList`
      Parameters:
        `itemFrom` - XBRLItem
      Returns:
        Iterator<XBRLFactItem>

    - #### getTuplesSg

          public java.util.Iterator<XBRLFactTuple> getTuplesSg(XBRLTuple tupleFrom)

      Description copied from interface: `XBRLFactsList`
      Iterator over fact tuples that are instances of the XBRLTuple received as a parameter of in the substitution group of that tuple.
      Specified by:
        `getTuplesSg` in interface `XBRLFactsList`
      Parameters:
        `tupleFrom` - the tuple from
      Returns:
        Iterator<XBRLFactTuple>

    - #### getNumberOfTuples

          public int getNumberOfTuples()

      Description copied from interface: `XBRLFactsList`
      Calculates and returns the number of tuples children of this facts container .
      Specified by:
        `getNumberOfTuples` in interface `XBRLFactsList`
      Returns:
        integer value

    - #### iterator

          public java.util.Iterator<XBRLFact> iterator()

      Description copied from interface: `XBRLFactsList`
      Iterator.
      Specified by:
        `iterator` in interface `XBRLFactsList`
      Returns:
        the iterator

    - #### remove

          public boolean remove(XBRLFact fact)

      Description copied from interface: `XBRLFactsList`
      Removes a fact from the facts container.
      Specified by:
        `remove` in interface `XBRLFactsList`
      Parameters:
        `fact` - the fact
      Returns:
        boolean

    - #### setParent

          public void setParent(XBRLFactsList parent)

      Description copied from class: `XBRLFact`
      Sets the parent of this XBRLFact to be the XBRLFactsList object used as a parameter.

      Setting the parent does not adds the fact as child of the parent element. This function do the following steps:

      1. if there are no changes (current parent is the same object as the object used as a parameter) then the function does nothing
      2. inform the old parent to remove the reference to the children
      3. sets parent of this object to be the object submitted as a parameter
      4. if the fact was assigned from a different instance document. Then relationships in the original instance document are removed from the new item.
      Specified by:
        `setParent` in interface `XBRLFactsList`
      Overrides:
        `setParent` in class `XBRLFact`
      Parameters:
        `parent` - the new parent

    - #### addOrForwardItem

          public void addOrForwardItem(XBRLFactItem item)

      Description copied from interface: `XBRLFactsList`
      Called internally to register new facts in the instance document.
      Specified by:
        `addOrForwardItem` in interface `XBRLFactsList`
      Parameters:
        `item` - the item

    - #### size

          public int size()

      Description copied from class: `XMLFragment`
      For complex type resources this returns the number of children elements that all are XML fragments This method may be overwriten by other classes in the hierarchy.
      Specified by:
        `size` in interface `XBRLFactsList`
      Overrides:
        `size` in class `XMLFragment`
      Returns:
        integer

    - #### getFriendlyName

          public java.lang.String getFriendlyName()

      Description copied from class: `XMLFragment`
      Returns a string description that represents the element content in a form that users can understand. This method may be overridden by parent classes.

      Remarks, this method may return very long names not suitable for user interface

      Overrides:
        `getFriendlyName` in class `XBRLFact`
      Returns:
        Non empty String. Internationalization is enabled

    - #### getFriendlyName

          public java.lang.String getFriendlyName(int modifiers,
                                         LabelsProvider lp)

      Description copied from class: `XBRLFact`
      Gets the friendly name.
      Overrides:
        `getFriendlyName` in class `XBRLFact`
      Parameters:
        `modifiers` - the modifiers
        `lp` - the lp
      Returns:
        a String representation of this fact.

    - #### get

          public XBRLFact get(int index)

      Description copied from interface: `XBRLFactsList`
      Returns the element at the selected index position. The first element is at position 0
      Specified by:
        `get` in interface `XBRLFactsList`
      Parameters:
        `index` - integer
      Returns:
        XBRLFact at position indicated by index parameter

    - #### indexOf

          public int indexOf(XBRLFact fact)

      Description copied from interface: `XBRLFactsList`
      Returns the index position of a fact within this list.
      Specified by:
        `indexOf` in interface `XBRLFactsList`
      Parameters:
        `fact` - XBRLFact
      Returns:
        integer

    - #### indexOf

          public int indexOf(XBRLFact fact,
                    int index)

      Description copied from interface: `XBRLFactsList`
      Returns the index position of a fact within this list starting at the position indicated by the index parameter.
      Specified by:
        `indexOf` in interface `XBRLFactsList`
      Parameters:
        `fact` - XBRLFact
        `index` - integer
      Returns:
        integer

    - #### clear

          public void clear()

      Description copied from class: `XBRLFact`
      Eliminates all this fact content.
      Specified by:
        `clear` in interface `XBRLFactsList`
      Overrides:
        `clear` in class `XBRLFact`

    - #### hashCode

          public int hashCode()

      Description copied from interface: `XBRLFactsList`
      This is from the Object interface and must be implemented by sub classes in order to be able to provide hashCodes.
      Specified by:
        `hashCode` in interface `XBRLFactsList`
      Overrides:
        `hashCode` in class `XBRLFact`
      Returns:
        integer

    - #### equals

          public boolean equals(java.lang.Object obj)

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

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

    - #### isDuplicate

          public boolean isDuplicate(XBRLFact otherFact)

      Description copied from class: `XBRLFact`
      Check if two items are duplicates as defined in the XBRL 2.1 specification
      Specified by:
        `isDuplicate` in class `XBRLFact`
      Parameters:
        `otherFact` - the other XBRLFactItem
      Returns:
        boolean