com.ihr.xbrl.om.xdt

## Class XDTPrimaryItem

- java.lang.Object
- - com.ihr.xbrl.om.xdt.XDTPrimaryItem

-     public class XDTPrimaryItem
      extends java.lang.Object

  An XDTPrimaryItem represents a concept definition XBRLItem that has dimensional information explicitly declared in the DTS. That is, it is linked with hypercubes directly or indirectly via inheritance mechanisms.

  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XDTPrimaryItem(XBRLItem item)` Creates a new XDTPrimaryItem instantiation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Iterator<javax.xml.namespace.QName>` | `allDimensionsInAllHypercubes()` Returns an iterator over all dimension QNames defined in all hypercubes linked with this primary item.
    `java.util.Iterator<DTSBase>` | `getBases()` Returns an iterator over DTSBase objects in which this XDTPrimary item has hypercubes that are directly or indirectly related but all providing real validation rules that requires to be validated.
    `int[]` | `getDimensionUseContainer(javax.xml.namespace.QName dimension)` This method explores all hypercubes used by this primary item and on all of them explores if the dimension is used in the segment container or in the scenario container and returns an array of two integers with the count of usages. index 0 of the array contains the uses in the segment and index 1 contains the uses in the scenario
    `java.util.Iterator<XDTHypercubeUse>` | `getHypercubes(DTSBase base)` Access to all Hypercube uses in the specific base set.
    `XBRLItem` | `getItem()` Access to the surrounding primary item.
    `void` | `setAffectedByHypercube(XDTHypercubeUse hypercube, XDTPrimaryItemUse primaryItemUse)` Set this object as affected by the hypercube received as a parameter.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XDTPrimaryItem

          public XDTPrimaryItem(XBRLItem item)

      Creates a new XDTPrimaryItem instantiation. There should be just one object of this type in the DTS. The XDTProcessor automatically creates it and store the instance in a cache indexed by QName

      Parameters:
        `item` - the item
      See Also:
        `XDTProcessor.getPrimaryItem(QName q)`

  - ### Method Detail

    - #### getItem

          public XBRLItem getItem()

      Access to the surrounding primary item.
      Returns:
        XBRLItem the item concept definition

    - #### setAffectedByHypercube

          public void setAffectedByHypercube(XDTHypercubeUse hypercube,
                                    XDTPrimaryItemUse primaryItemUse)

      Set this object as affected by the hypercube received as a parameter. Cascade to all XDTPrimaryItem objects in the dom-mem network
      Parameters:
        `hypercube` - the hypercube
        `primaryItemUse` - the primary item use

    - #### getBases

          public java.util.Iterator<DTSBase> getBases()

      Returns an iterator over DTSBase objects in which this XDTPrimary item has hypercubes that are directly or indirectly related but all providing real validation rules that requires to be validated.

      According to the XDT specification, at least all hypercubes in one DTSBase MUST be dimensionally valid.

      Returns:
        Iterator<DTSBase>

    - #### getHypercubes

          public java.util.Iterator<XDTHypercubeUse> getHypercubes(DTSBase base)

      Access to all Hypercube uses in the specific base set. Each hypercube use may be different from primary item to primary item.

      According to the XDT specification, all hypercubes in a base set MUST be dimensionally valid in order to consider the primary item is dimensionally valid

      Parameters:
        `base` - the base
      Returns:
        Iterator<XDTHypercubeUse>

    - #### allDimensionsInAllHypercubes

          public java.util.Iterator<javax.xml.namespace.QName> allDimensionsInAllHypercubes()

      Returns an iterator over all dimension QNames defined in all hypercubes linked with this primary item. If the same dimension exists in more than one hypercube it is returned only once
      Returns:
        Iterator over dimension QNames

    - #### getDimensionUseContainer

          public int[] getDimensionUseContainer(javax.xml.namespace.QName dimension)

      This method explores all hypercubes used by this primary item and on all of them explores if the dimension is used in the segment container or in the scenario container and returns an array of two integers with the count of usages. index 0 of the array contains the uses in the segment and index 1 contains the uses in the scenario
      Parameters:
        `dimension` - the dimension
      Returns:
        int[2] where int[0] = count of dimension uses in the segment, int[1] = count of dimension uses in the scenario
      Since:
        2.8.6