com.ihr.xbrl.om.formula.util

## Class XFIImplicitFilterOptimizer

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

- All Implemented Interfaces:
    Filter

      public class XFIImplicitFilterOptimizer
      extends java.lang.Object
      implements Filter

  This class allows for optimizations to reduce the number of facts that shall be selected for evaluation of a fact variable that is using implicit filtering with other fact variables. The class instance belongs to the variable set.
  Author:
    Ignacio

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `XFIImplicitFilterOptimizer.Type` The Enum Type.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XFIImplicitFilterOptimizer(int aspectModel, int uncoveredAspects)` Instantiates a new XFI implicit filter optimizer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canUseFallback(javax.xml.namespace.QName variableName)` Can use fallback.
    `boolean` | `checkUncoveredAspects(XBRLFact fact)` Returns true then the fact passed in matches all uncovered aspects in fact previously set.
    `java.util.ArrayList<net.sf.saxon.om.Item<?>>` | `getOptimizedListIterator(XFIImplicitFilterOptimizer.Type t)` Gets the optimized list iterator.
    `boolean` | `isOptimizedSet()` Checks if is optimized set.
    `boolean` | `passes(javax.xml.namespace.QName varName, net.sf.saxon.s9api.XdmValue value, boolean bBindToDefault)` Passes.
    `void` | `recoverLevel(int level)` Recover level.
    `void` | `reset()` Prepares the optimizer for a new evaluation cycle.
    `void` | `restartFilter()` Restart filter.
    `void` | `setFactReference(XBRLFact fact, javax.xml.namespace.QName variableName, boolean bBindToDefault)` Sets the fact reference.
    `void` | `setOptimizedListIterator(java.util.ArrayList<net.sf.saxon.om.Item<?>> al, XFIImplicitFilterOptimizer.Type t)` Sets the optimized list iterator.
    `void` | `setTree(XBRLVariableTree tree)` Sets the tree.
    `void` | `setVariableName(XBRLVariableFact variable, javax.xml.namespace.QName variableName)` Sets the variable name.

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

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

- - ### Constructor Detail

    - #### XFIImplicitFilterOptimizer

          public XFIImplicitFilterOptimizer(int aspectModel,
                                    int uncoveredAspects)

      Instantiates a new XFI implicit filter optimizer.
      Parameters:
        `aspectModel` - the aspect model
        `uncoveredAspects` - the uncovered aspects

  - ### Method Detail

    - #### setVariableName

          public void setVariableName(XBRLVariableFact variable,
                             javax.xml.namespace.QName variableName)

      Sets the variable name.
      Parameters:
        `variable` - the variable
        `variableName` - the variable name

    - #### setFactReference

          public void setFactReference(XBRLFact fact,
                              javax.xml.namespace.QName variableName,
                              boolean bBindToDefault)

      Sets the fact reference.
      Parameters:
        `fact` - the fact
        `variableName` - the variable name
        `bBindToDefault` - the b bind to default

    - #### recoverLevel

          public void recoverLevel(int level)

      Recover level.
      Parameters:
        `level` - the level

    - #### canUseFallback

          public boolean canUseFallback(javax.xml.namespace.QName variableName)

      Can use fallback.
      Parameters:
        `variableName` - the variable name
      Returns:
        true, if successful

    - #### getOptimizedListIterator

          public java.util.ArrayList<net.sf.saxon.om.Item<?>> getOptimizedListIterator(XFIImplicitFilterOptimizer.Type t)

      Gets the optimized list iterator.
      Parameters:
        `t` - the t
      Returns:
        the optimized list iterator

    - #### setOptimizedListIterator

          public void setOptimizedListIterator(java.util.ArrayList<net.sf.saxon.om.Item<?>> al,
                                      XFIImplicitFilterOptimizer.Type t)

      Sets the optimized list iterator.
      Parameters:
        `al` - the al
        `t` - the t

    - #### checkUncoveredAspects

          public boolean checkUncoveredAspects(XBRLFact fact)

      Returns true then the fact passed in matches all uncovered aspects in fact previously set.
      Parameters:
        `fact` - the fact
      Returns:
        true, if successful

    - #### reset

          public void reset()

      Prepares the optimizer for a new evaluation cycle.

    - #### isOptimizedSet

          public boolean isOptimizedSet()

      Checks if is optimized set.
      Returns:
        true, if is optimized set

    - #### setTree

          public void setTree(XBRLVariableTree tree)

      Sets the tree.
      Parameters:
        `tree` - the new tree

    - #### passes

          public boolean passes(javax.xml.namespace.QName varName,
                       net.sf.saxon.s9api.XdmValue value,
                       boolean bBindToDefault)

      Description copied from interface: `Filter`
      Passes.
      Specified by:
        `passes` in interface `Filter`
      Parameters:
        `varName` - the var name
        `value` - the value
        `bBindToDefault` - the b bind to default
      Returns:
        true, if successful

    - #### restartFilter

          public void restartFilter()

      Restart filter.