com.ihr.xbrl.om.formula

## Class FContext

- java.lang.Object
- - com.ihr.xbrl.om.formula.FContext

-     public class FContext
      extends java.lang.Object

  This is the Formula interpretation of the XBRL Segment or XBRL Scenario dimensions container of an XBRL context. This is different from the Dimensions model of the same information. This object holds the dimensional information and the non dimensional information nodes so the formula processor can work with them easily
  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FContext(XBRLFactItem factitem)` Instantiates a new f context.
    `FContext(XMLElementDefinition el)` Instantiates a new f context.
    `FContext(XMLElementDefinition el, XBRLContext ctx)` Instantiates a new f context.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(XMLFragment fr, int container, boolean bIsOcc)` Adds the.
    `void` | `clear()` Clears all dimensional and non dimensional information on this context.
    `XMLFragment` | `getDimension(javax.xml.namespace.QName dimName)` Returns the dimension value associated to the dimension passed in in the dimName parameter.
    `int` | `getDimensionContainer(javax.xml.namespace.QName dimName)` Gets the dimension container.
    `java.util.Collection<javax.xml.namespace.QName>` | `getDimensions()` Returns a collection of QNames for of all XDT dimensions explicitly written in the context, either in the segment or the scenario containers.
    `java.util.Collection<XMLFragment>` | `getNonDimensionalInformation(int container)` Returns a collection of fragments with non dimensional information in the context container indicated in the parameter.
    `XBRLDimensionsContainer` | `getXBRLContext(int container)` Converts the internal structures back to an XBRLContext object.
    `static boolean` | `isExplicitDimensionContainer(XMLFragment fragment)` returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions.
    `static boolean` | `isTypedDimensionContainer(XMLFragment fragment)` returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions.
    `void` | `remove(XMLFragment fr, int container, boolean bIsOcc)` Removes the.
    `void` | `removeDim(javax.xml.namespace.QName dimName)` Removes the dim.
    `void` | `setDimension(javax.xml.namespace.QName dimName, XMLFragment dimension, int dimensionContainer)` Sets a value for the indicated dimension in the indicated dimension container.
    `void` | `setXBRLContext(XBRLContext context)` Stores the information form an XBRL context inside the internal structure.
    `void` | `setXBRLScenario(XBRLScenario scenario)` Sets the XBRL scenario.
    `void` | `setXBRLSegment(XBRLSegment segment)` Sets the XBRL segment.
    `void` | `unsetXBRLScenario(XBRLScenario scenario)` Unset xbrl scenario.
    `void` | `unsetXBRLSegment(XBRLSegment segment)` Unset xbrl segment.

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

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

- - ### Constructor Detail

    - #### FContext

          public FContext(XMLElementDefinition el)

      Instantiates a new f context.
      Parameters:
        `el` - the el

    - #### FContext

          public FContext(XMLElementDefinition el,
                  XBRLContext ctx)

      Instantiates a new f context.
      Parameters:
        `el` - the element to obtain the context from. May be null
        `ctx` - the XBRL context, must not be null if el is null

    - #### FContext

          public FContext(XBRLFactItem factitem)

      Instantiates a new f context.
      Parameters:
        `factitem` - the fact item to work with

  - ### Method Detail

    - #### setXBRLContext

          public void setXBRLContext(XBRLContext context)

      Stores the information form an XBRL context inside the internal structure.
      Parameters:
        `context` - the new XBRL context

    - #### setXBRLSegment

          public void setXBRLSegment(XBRLSegment segment)

      Sets the XBRL segment.
      Parameters:
        `segment` - the new XBRL segment

    - #### setXBRLScenario

          public void setXBRLScenario(XBRLScenario scenario)

      Sets the XBRL scenario.
      Parameters:
        `scenario` - the new XBRL scenario

    - #### add

          public void add(XMLFragment fr,
                 int container,
                 boolean bIsOcc)
                   throws XFxbrlfeBadSubsequentOCCValue

      Adds the.
      Parameters:
        `fr` - the fr
        `container` - use -1 in the case of dimensions to NOT CHANGE original container. use XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario
        `bIsOcc` - the b is occ
      Throws:
        `XFxbrlfeBadSubsequentOCCValue` - the x fxbrlfe bad subsequent occ value

    - #### unsetXBRLSegment

          public void unsetXBRLSegment(XBRLSegment segment)

      Unset xbrl segment.
      Parameters:
        `segment` - the segment

    - #### unsetXBRLScenario

          public void unsetXBRLScenario(XBRLScenario scenario)

      Unset xbrl scenario.
      Parameters:
        `scenario` - the scenario

    - #### remove

          public void remove(XMLFragment fr,
                    int container,
                    boolean bIsOcc)
                      throws XFxbrlfeBadSubsequentOCCValue

      Removes the.
      Parameters:
        `fr` - the fr
        `container` - the container
        `bIsOcc` - the b is occ
      Throws:
        `XFxbrlfeBadSubsequentOCCValue` - the x fxbrlfe bad subsequent occ value

    - #### getXBRLContext

          public XBRLDimensionsContainer getXBRLContext(int container)

      Converts the internal structures back to an XBRLContext object.

      Note during the construction of this function, the time and entity is not stored so this class will not be able to generate a complete context. It can only generate the scenario container or the segment container as indicated in the parameters passed in.

      Parameters:
        `container` - use XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario
      Returns:
        the XBRL context

    - #### clear

          public void clear()

      Clears all dimensional and non dimensional information on this context. All containers are clear.

    - #### removeDim

          public void removeDim(javax.xml.namespace.QName dimName)

      Removes the dim.
      Parameters:
        `dimName` - the dim name

    - #### getDimensions

          public java.util.Collection<javax.xml.namespace.QName> getDimensions()

      Returns a collection of QNames for of all XDT dimensions explicitly written in the context, either in the segment or the scenario containers.
      Returns:
        Collection of QNames

    - #### getDimension

          public XMLFragment getDimension(javax.xml.namespace.QName dimName)

      Returns the dimension value associated to the dimension passed in in the dimName parameter.

      The returned data is the XMLFragment including the explicit or implicit member container.

      If the dimension has a default, the default is not reported in the context. This method only cares about explicitly written values in the context so the returned value will always be null when a dimension for which a default has been reported is passed in. Note that if, according with other interpretations of closed hypercubes, the dimension for which a default does not apply for the primary item, this method will also return when that dimension is used.

      Parameters:
        `dimName` - the dim name
      Returns:
        the dimension

    - #### getDimensionContainer

          public int getDimensionContainer(javax.xml.namespace.QName dimName)

      Gets the dimension container.
      Parameters:
        `dimName` - the dim name
      Returns:
        integer constant XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario

    - #### setDimension

          public void setDimension(javax.xml.namespace.QName dimName,
                          XMLFragment dimension,
                          int dimensionContainer)

      Sets a value for the indicated dimension in the indicated dimension container.

      in order to get the preferred dimension container for a dimension call the `getDimensionContainer(QName)` method.

      the dimension value must contain all elements including the xbrli:explicitMember or xbrli:typedMember element and all required attributes.

      Parameters:
        `dimName` - the dim name
        `dimension` - the dimension
        `dimensionContainer` - XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario
      See Also:
        `getDimensionContainer(QName)`

    - #### getNonDimensionalInformation

          public java.util.Collection<XMLFragment> getNonDimensionalInformation(int container)

      Returns a collection of fragments with non dimensional information in the context container indicated in the parameter. Or null if the context container is invalid.
      Parameters:
        `container` - either XDTHypercubeUse.SCENARIO or XDTHypercubeUse.SEGMENT
      Returns:
        a Collection<XMLFragment> instance

    - #### isExplicitDimensionContainer

          public static boolean isExplicitDimensionContainer(XMLFragment fragment)

      returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions.
      Parameters:
        `fragment` - the fragment
      Returns:
        boolean

    - #### isTypedDimensionContainer

          public static boolean isTypedDimensionContainer(XMLFragment fragment)

      returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions.
      Parameters:
        `fragment` - the fragment
      Returns:
        boolean