com.ihr.xbrl.om.formula.util

## Class VariablesLoopController

- java.lang.Object
- - com.ihr.xbrl.om.formula.util.VariablesLoopController

-     public class VariablesLoopController
      extends java.lang.Object

  This class is a controller for iterators over all binded variables for a formula.
  Author:
    Ignacio

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `VariablesLoopController.ClsVariableSetCombinationsIterator` The Class ClsVariableSetCombinationsIterator.
    `static class` | `VariablesLoopController.ClsVariableSetCombinationsIterator2` The Class ClsVariableSetCombinationsIterator2.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VariablesLoopController()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `LookForwardAndFilterIterator` | `createIterator(javax.xml.namespace.QName varName)` Creates the iterator.
    `VariablesLoopController.ClsVariableSetCombinationsIterator` | `getImplicitFilterController(XBRLVariableSetResource xbrlVariableSetResource)` Gets the implicit filter controller.
    `int` | `getLevel()` Gets the level.
    `boolean` | `hasActiveSubPartitioning()` Checks for active sub partitioning.
    `boolean` | `hasNext()` Checks for next.
    `boolean` | `hasNext(javax.xml.namespace.QName variableName)` Checks for next.
    `void` | `initialize(XBRLVariableTree tree, XMLEvaluationContextProvider evalProvider, java.util.Vector<XBRLVariableResourceUse> evaluatedVars)` Initializes the VariablesLoopController by setting the value of the tree that contains the variables required for each evaluation level and the interdependencies between variables.
    `boolean` | `isFallbackValue(javax.xml.namespace.QName variableName)` Checks if is fallback value.
    `boolean` | `isValidInitialBinding()` Checks if is valid initial binding.
    `void` | `next()` Next.
    `net.sf.saxon.s9api.XdmValue` | `next(javax.xml.namespace.QName variableName, XBRLVariableResource res)` This returns the next element in the sequence or the last returned element in the sequence if the sequence is not the topmost sequence in the stack.
    `boolean` | `uninitialized()` Uninitialized.

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

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

- - ### Constructor Detail

    - #### VariablesLoopController

          public VariablesLoopController()

  - ### Method Detail

    - #### hasNext

          public boolean hasNext(javax.xml.namespace.QName variableName)
                          throws XFValidationException

      Checks for next.
      Parameters:
        `variableName` - the variable name
      Returns:
        true, if successful
      Throws:
        `XFValidationException` - the XF validation exception

    - #### next

          public net.sf.saxon.s9api.XdmValue next(javax.xml.namespace.QName variableName,
                                         XBRLVariableResource res)
                                           throws XFValidationException

      This returns the next element in the sequence or the last returned element in the sequence if the sequence is not the topmost sequence in the stack.
      Parameters:
        `variableName` - the variable name
        `res` - the res
      Returns:
        the xdm value
      Throws:
        `XFValidationException` - the XF validation exception

    - #### getImplicitFilterController

          public VariablesLoopController.ClsVariableSetCombinationsIterator getImplicitFilterController(XBRLVariableSetResource xbrlVariableSetResource)

      Gets the implicit filter controller.
      Parameters:
        `xbrlVariableSetResource` - the xbrl variable set resource
      Returns:
        the implicit filter controller

    - #### hasActiveSubPartitioning

          public boolean hasActiveSubPartitioning()

      Checks for active sub partitioning.
      Returns:
        true, if successful

    - #### isFallbackValue

          public boolean isFallbackValue(javax.xml.namespace.QName variableName)
                                  throws XFValidationException

      Checks if is fallback value.
      Parameters:
        `variableName` - the variable name
      Returns:
        true, if is fallback value
      Throws:
        `XFValidationException` - the XF validation exception

    - #### uninitialized

          public boolean uninitialized()

      Uninitialized.
      Returns:
        true, if successful

    - #### createIterator

          public LookForwardAndFilterIterator createIterator(javax.xml.namespace.QName varName)

      Creates the iterator.
      Parameters:
        `varName` - the var name
      Returns:
        the cls var iterator

    - #### getLevel

          public int getLevel()

      Gets the level.
      Returns:
        the level

    - #### initialize

          public void initialize(XBRLVariableTree tree,
                        XMLEvaluationContextProvider evalProvider,
                        java.util.Vector<XBRLVariableResourceUse> evaluatedVars)
                          throws XFValidationException

      Initializes the VariablesLoopController by setting the value of the tree that contains the variables required for each evaluation level and the interdependencies between variables.

      Then, create an iterator that can be used for iterating throw all variables

      Then move to the first value in the loop.

      Then, initialization is finished.

      A call to next() will return the calculated value and move forward to the next element and so on.

      Parameters:
        `tree` - the tree
        `evalProvider` - the eval provider
        `evaluatedVars` - the evaluated vars
      Throws:
        `XFValidationException` - the XF validation exception

    - #### hasNext

          public boolean hasNext()

      Checks for next.
      Returns:
        true, if successful

    - #### next

          public void next()
                    throws XFValidationException

      Next.
      Throws:
        `XFValidationException` - the XF validation exception

    - #### isValidInitialBinding

          public boolean isValidInitialBinding()

      Checks if is valid initial binding.
      Returns:
        true, if is valid initial binding