com.ihr.xbrl.mapper

## Class Fact

- java.lang.Object
- - com.ihr.xbrl.mapper.Fact

- All Implemented Interfaces:
    HasFacts

      public class Fact
      extends java.lang.Object
      implements HasFacts

  Represents instructions to create a fact item or tuple.
  Author:
    Ignacio

- - ### Nested Class Summary

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

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALL` The Constant ALL.
    `static int` | `PREV` The Constant PREV.
    `static int` | `SINGLE` The Constant SINGLE.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Fact(Fact.Type type, HasFacts parent, XBRLDataSource source, MapperContext context, java.lang.String mapIdentifier, XMLElementDefinition concept, XBRLUnit unit, int multi)` Instantiates a new fact.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addFact(Fact newFact)` Adds a new Fact to the end of the Facts container.
    `void` | `addFactAt(Fact newFact, int pos)` Adds a new Fact at the position indicated by pos.
    `void` | `delFact(Fact fact)` Removes a fact from the container.
    `boolean` | `equals(java.lang.Object obj)` Equals.
    `java.util.Iterator<Fact>` | `getChildrenFacts()` Access to an iterator over the children facts of this object.
    `XMLElementDefinition` | `getConcept()` The concept definition in the taxonomy that corresponds to this fact in the template.
    `MapperContext` | `getContext()` Gets the context.
    `java.util.Collection<XBRLFact>` | `getFacts(XBRLFactsList cf, int index)` Gets the facts.
    `java.lang.String` | `getMapIdentifier()` Gets the map identifier.
    `int` | `getMulti()` Gets the multi.
    `int` | `getNumberOfValues()` Gets the number of values.
    `HasFacts` | `getParent()` Access to the parent of this template Fact.
    `Section` | `getSection()` Gets the section.
    `XBRLDataSource` | `getSource()` Gets the source.
    `Fact.Type` | `getType()` Gets the type.
    `XBRLUnit` | `getUnit()` Gets the unit.
    `net.sf.saxon.value.AtomicValue` | `getValue(int index)` Gets the value.
    `int` | `hashCode()` Hash code.
    `void` | `registerFact(Fact fact)` Registers a new fact has been added to the container.
    `void` | `setSection(Section section)` Sets the section.
    `void` | `unregisterFact(Fact fact)` Same as `HasFacts.registerFact(Fact)` but in this case for removing the information stored.

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

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ALL

          public static final int ALL

      The Constant ALL.
      See Also:
        Constant Field Values

    - #### SINGLE

          public static final int SINGLE

      The Constant SINGLE.
      See Also:
        Constant Field Values

    - #### PREV

          public static final int PREV

      The Constant PREV.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Fact

          public Fact(Fact.Type type,
              HasFacts parent,
              XBRLDataSource source,
              MapperContext context,
              java.lang.String mapIdentifier,
              XMLElementDefinition concept,
              XBRLUnit unit,
              int multi)

      Instantiates a new fact.
      Parameters:
        `type` - the type
        `parent` - the parent
        `source` - the source
        `context` - the context
        `mapIdentifier` - the map identifier
        `concept` - the concept
        `unit` - the unit
        `multi` - the multi

  - ### Method Detail

    - #### getMulti

          public int getMulti()

      Gets the multi.
      Returns:
        the multi

    - #### getContext

          public MapperContext getContext()

      Gets the context.
      Returns:
        the context

    - #### getSource

          public XBRLDataSource getSource()

      Gets the source.
      Returns:
        the source

    - #### getMapIdentifier

          public java.lang.String getMapIdentifier()

      Gets the map identifier.
      Returns:
        the mapIdentifier

    - #### getConcept

          public XMLElementDefinition getConcept()

      The concept definition in the taxonomy that corresponds to this fact in the template.
      Returns:
        the concept this is either an XBRLItem or XBRLTuple

    - #### getUnit

          public XBRLUnit getUnit()

      Gets the unit.
      Returns:
        the unit. If this is not a numeric unit or it is a tuple null is returned

    - #### getParent

          public HasFacts getParent()

      Access to the parent of this template Fact. This is another template fact (tuple) or the mapper instance (the template document). Note that Fact and Mapper implements the HasFacts interface.
      Specified by:
        `getParent` in interface `HasFacts`
      Returns:
        the parent of this Fact

    - #### getType

          public Fact.Type getType()

      Gets the type.
      Returns:
        the type

    - #### getNumberOfValues

          public int getNumberOfValues()

      Gets the number of values.
      Returns:
        Integer

    - #### getValue

          public net.sf.saxon.value.AtomicValue getValue(int index)
                                                  throws MapException

      Gets the value.
      Parameters:
        `index` - the index
      Returns:
        Value (Object in the Saxon library)
      Throws:
        `MapException` - the map exception

    - #### getFacts

          public java.util.Collection<XBRLFact> getFacts(XBRLFactsList cf,
                                                int index)
                                                  throws MapException

      Gets the facts.
      Parameters:
        `cf` - the cf
        `index` - the index
      Returns:
        a new XBRLFact
      Throws:
        `MapException` - the map exception

    - #### getChildrenFacts

          public java.util.Iterator<Fact> getChildrenFacts()

      Description copied from interface: `HasFacts`
      Access to an iterator over the children facts of this object.
      Specified by:
        `getChildrenFacts` in interface `HasFacts`
      Returns:
        Iterator over children facts

    - #### addFact

          public void addFact(Fact newFact)

      Description copied from interface: `HasFacts`
      Adds a new Fact to the end of the Facts container.

      This method does not updates the taxonomy URLs.

      Specified by:
        `addFact` in interface `HasFacts`
      Parameters:
        `newFact` - the new fact to be added

    - #### addFactAt

          public void addFactAt(Fact newFact,
                       int pos)

      Description copied from interface: `HasFacts`
      Adds a new Fact at the position indicated by pos.
      Specified by:
        `addFactAt` in interface `HasFacts`
      Parameters:
        `newFact` - Fact to be added
        `pos` - integer. Zero based

    - #### delFact

          public void delFact(Fact fact)

      Description copied from interface: `HasFacts`
      Removes a fact from the container.
      Specified by:
        `delFact` in interface `HasFacts`
      Parameters:
        `fact` - Fact to remove

    - #### registerFact

          public void registerFact(Fact fact)

      Description copied from interface: `HasFacts`
      Registers a new fact has been added to the container. This method updates the Hashtables in the instance template and passes UP to its parent the registration of facts for tuples. This method is called internally by the API and should not be called manually
      Specified by:
        `registerFact` in interface `HasFacts`
      Parameters:
        `fact` - the fact

    - #### unregisterFact

          public void unregisterFact(Fact fact)

      Description copied from interface: `HasFacts`
      Same as `HasFacts.registerFact(Fact)` but in this case for removing the information stored.
      Specified by:
        `unregisterFact` in interface `HasFacts`
      Parameters:
        `fact` - the fact

    - #### setSection

          public void setSection(Section section)

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

    - #### getSection

          public Section getSection()

      Gets the section.
      Returns:
        the section

    - #### hashCode

          public int hashCode()

      Description copied from interface: `HasFacts`
      Hash code.
      Specified by:
        `hashCode` in interface `HasFacts`
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        the int

    - #### equals

          public boolean equals(java.lang.Object obj)

      Description copied from interface: `HasFacts`
      Equals.
      Specified by:
        `equals` in interface `HasFacts`
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the obj
      Returns:
        true, if successful