com.ihr.xbrl.formula

## Class FlVariable

- java.lang.Object
- - com.ihr.xbrl.formula.FlVariableDepend
  - - com.ihr.xbrl.formula.FlXPathObject
    - - com.ihr.xbrl.formula.FlVariable

- All Implemented Interfaces:
    FlValue, java.util.Iterator<java.lang.Object>

      public class FlVariable
      extends FlXPathObject
      implements FlValue, java.util.Iterator<java.lang.Object>

  The Class FlVariable.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `bindAsSequence()` Bind as sequence.
    `void` | `compile()` Compile.
    `boolean` | `evaluateVariable()` If the variable hasn't been evaluated before or is on the reset state a call to this method will evaluate the XPath expression associated to the variable.
    `java.lang.Object` | `getLastReturnedValue()` This method does not calculate the variable and can be called multiple times wihtout modifying the status of this object.
    `javax.xml.namespace.QName` | `getName()` Gets the name.
    `net.sf.saxon.s9api.XdmValue` | `getXPathResult()` This method return the value calculated as a call to the evaluate method.
    `boolean` | `hasNext()` Returns true if the FlVariable has been evaluated, does not bind as a sequence, and the sequence has a next value to return.
    `java.lang.Object` | `next()` Return the next object in the sequence if the FlVariable has been evaluated.
    `void` | `remove()`
    `void` | `reset()` Reset.
    `java.lang.String` | `toString()`
    `java.lang.Object` | `valueOrNext()` Return the FlVariable value or the next value in the sequence if this variable does not bind as sequence.

    - ### Methods inherited from class com.ihr.xbrl.formula.FlXPathObject

      `getXPathString, setNamespace, setNamespaces`

    - ### Methods inherited from class com.ihr.xbrl.formula.FlVariableDepend

      `evaluate, getFormulaProcessor`

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

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

- - ### Method Detail

    - #### getName

          public javax.xml.namespace.QName getName()

      Gets the name.
      Returns:
        the variable QName

    - #### compile

          public void compile()
                       throws FlCompilationException

      Compile.
      Throws:
        `FlCompilationException` - the fl compilation exception

    - #### bindAsSequence

          public boolean bindAsSequence()

      Bind as sequence.
      Returns:
        true, if successful

    - #### reset

          public void reset()

      Reset.

    - #### evaluateVariable

          public boolean evaluateVariable()
                                   throws FormulaRuntimeException

      If the variable hasn't been evaluated before or is on the reset state a call to this method will evaluate the XPath expression associated to the variable.
      Returns:
        boolean value indicating whether or not the xpath expression has been evaluated
      Throws:
        `FormulaRuntimeException` - the formula runtime exception

    - #### hasNext

          public boolean hasNext()

      Returns true if the FlVariable has been evaluated, does not bind as a sequence, and the sequence has a next value to return.
      Specified by:
        `hasNext` in interface `java.util.Iterator<java.lang.Object>`
      Returns:
        true, if successful

    - #### next

          public java.lang.Object next()

      Return the next object in the sequence if the FlVariable has been evaluated.
      Specified by:
        `next` in interface `java.util.Iterator<java.lang.Object>`
      Returns:
        the object

    - #### remove

          public void remove()

      Specified by:
        `remove` in interface `java.util.Iterator<java.lang.Object>`

    - #### getLastReturnedValue

          public java.lang.Object getLastReturnedValue()

      This method does not calculate the variable and can be called multiple times wihtout modifying the status of this object.
      Returns:
        the last value of this variable

    - #### valueOrNext

          public java.lang.Object valueOrNext()

      Return the FlVariable value or the next value in the sequence if this variable does not bind as sequence.
      Returns:
        Object

    - #### getXPathResult

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

      This method return the value calculated as a call to the evaluate method.
      Specified by:
        `getXPathResult` in interface `FlValue`
      Returns:
        the object returned by the evaluate method.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`