com.ihr.xbrl.dts

## Class InstanceExplorerAbstract

- java.lang.Object
- - com.ihr.xbrl.dts.InstanceExplorerAbstract

- All Implemented Interfaces:
    ContextProvider, InstanceExplorerInterface, InstanceExplorerListener, UnitsProvider
  Direct Known Subclasses:
    DimensionalInstanceExplorer, InstanceExplorer

      public abstract class InstanceExplorerAbstract
      extends java.lang.Object
      implements InstanceExplorerInterface, InstanceExplorerListener

  The Class InstanceExplorerAbstract.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ACUM_Q1Q3` The Constant ACUM_Q1Q3.
    `static int` | `ALL` The Constant ALL.
    `static int` | `DAYS` The Constant DAYS.
    `static int` | `FOREVER` The Constant FOREVER.
    `static int` | `HALVES` The Constant HALVES.
    `static int` | `HOURS` The Constant HOURS.
    `static int` | `INSTANT` The Constant INSTANT.
    `static int` | `MINUTES` The Constant MINUTES.
    `static int` | `MONTHS` The Constant MONTHS.
    `static int` | `NONSTANDARD` The Constant NONSTANDARD.
    `static com.ihr.xbrl.dts.InstanceExplorerAbstract.ClsNotesOrderer` | `notesOrderer` The notes orderer.
    `static int` | `QUARTERS` The Constant QUARTERS.
    `static java.lang.String` | `sDays` The Constant sDays.
    `static int` | `SECONDS` The Constant SECONDS.
    `static java.lang.String` | `sForever` The Constant sForever.
    `static java.lang.String` | `sHalves` The Constant sHalves.
    `static java.lang.String` | `sHours` The Constant sHours.
    `static java.lang.String` | `sMinutes` The Constant sMinutes.
    `static java.lang.String` | `sMonths` The Constant sMonths.
    `static java.lang.String` | `sNonstandard` The Constant sNonstandard.
    `static java.lang.String` | `sQuarters` The Constant sQuarters.
    `static java.lang.String` | `sSeconds` The Constant sSeconds.
    `static java.lang.String` | `sWeeks` The Constant sWeeks.
    `static java.lang.String` | `sYears` The Constant sYears.
    `static javax.xml.namespace.QName` | `unkownUnit` The Constant unkownUnit.
    `static int` | `WEEKS` The Constant WEEKS.
    `static int` | `YEARS` The Constant YEARS.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addInstanceExplorerListener(InstanceExplorerListener l)` Adds the instance explorer listener.
    `void` | `clear()` Clear.
    `java.util.Iterator<CompanyKey>` | `getCompanyKeys()` Access to an iterator over the keys for company data.
    `VNotes` | `getFactNotes(XBRLFact fact)` Gets the fact notes.
    `static InstanceExplorerListener[]` | `getInstanceExplorerListeners()` Gets the instance explorer listeners.
    `int` | `getNumberOfCompanies()` Access to the number of different companies this instance have stored information .
    `static int` | `getNumTokens()` Returns the number of tokens that represents column types by the column range.
    `static java.lang.String` | `getStringOfDateStep(java.util.GregorianCalendar dateStart, java.util.GregorianCalendar dateEnd, int dateStep)` Gets the string of date step.
    `static java.lang.String` | `getStringOfPeriod(XBRLPeriod period)` Returns text representation of an XBRLPeriod that is suitable for GUIs.
    `XBRLUnit` | `getSuggestedUnit(CompanyKey ck, XBRLItem itm)` Returns a suggested unit for a numeric concept definition.
    `java.util.Iterator<XBRLUnit>` | `getSuggestedUnits(XBRLItem itm)` Implementation of the UnitsProvider interface The algorithm considers other units in this report and put first the "suggested unit" for this fact item.
    `java.util.Iterator<VNotes>` | `getVNotes()` Gets the v notes.
    `boolean` | `hasDataForCompany(CompanyKey ck)` Checks for data for company.
    `static int` | `indexOfDateStepCode(int dateStep)` Return the index of the dateStep code in the internally ordered array of dateStep codes.
    `void` | `instanceEvent(InstanceExplorerEvent e)` Instance event.
    `static java.lang.String` | `intTokenToString(int dateStep)` Converts an integer value into the string representation See: `intTokenToString(int)` for more information.
    `static void` | `removeInstanceExplorerListener(InstanceExplorerListener l)` Removes the instance explorer listener.
    `static void` | `sendEvent(InstanceExplorerEvent event)` Send event.
    `void` | `setSuggestedUnit(XBRLItem item, CompanyKey ck, XBRLUnit unit)` Sets the suggested unit.
    `static int` | `stepsCodeForIndex(int index)` Access to the dateStep code corresponding to the index in the sequence.
    `static int` | `stringTokenToInt(java.lang.String dateStep)` Transform a string representation of a token for a period into the corresponding integer value.

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

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

    - ### Methods inherited from interface com.ihr.xbrl.dts.InstanceExplorerInterface

      `addFact, delFact, findFact, getInstance, setInstance`

    - ### Methods inherited from interface com.ihr.xbrl.dts.ContextProvider

      `addContext, factChangedContext, getCompatibleContexts`

    - ### Methods inherited from interface com.ihr.xbrl.dts.UnitsProvider

      `factChangedUnit`

- - ### Field Detail

    - #### FOREVER

          public static final int FOREVER

      The Constant FOREVER.
      See Also:
        Constant Field Values

    - #### YEARS

          public static final int YEARS

      The Constant YEARS.
      See Also:
        Constant Field Values

    - #### HALVES

          public static final int HALVES

      The Constant HALVES.
      See Also:
        Constant Field Values

    - #### QUARTERS

          public static final int QUARTERS

      The Constant QUARTERS.
      See Also:
        Constant Field Values

    - #### MONTHS

          public static final int MONTHS

      The Constant MONTHS.
      See Also:
        Constant Field Values

    - #### WEEKS

          public static final int WEEKS

      The Constant WEEKS.
      See Also:
        Constant Field Values

    - #### DAYS

          public static final int DAYS

      The Constant DAYS.
      See Also:
        Constant Field Values

    - #### HOURS

          public static final int HOURS

      The Constant HOURS.
      See Also:
        Constant Field Values

    - #### MINUTES

          public static final int MINUTES

      The Constant MINUTES.
      See Also:
        Constant Field Values

    - #### SECONDS

          public static final int SECONDS

      The Constant SECONDS.
      See Also:
        Constant Field Values

    - #### NONSTANDARD

          public static final int NONSTANDARD

      The Constant NONSTANDARD.
      See Also:
        Constant Field Values

    - #### INSTANT

          public static final int INSTANT

      The Constant INSTANT.
      See Also:
        Constant Field Values

    - #### ALL

          public static final int ALL

      The Constant ALL.
      See Also:
        Constant Field Values

    - #### ACUM_Q1Q3

          public static final int ACUM_Q1Q3

      The Constant ACUM_Q1Q3.
      See Also:
        Constant Field Values

    - #### sForever

          public static final java.lang.String sForever

      The Constant sForever.

    - #### sYears

          public static final java.lang.String sYears

      The Constant sYears.

    - #### sHalves

          public static final java.lang.String sHalves

      The Constant sHalves.

    - #### sQuarters

          public static final java.lang.String sQuarters

      The Constant sQuarters.

    - #### sMonths

          public static final java.lang.String sMonths

      The Constant sMonths.

    - #### sWeeks

          public static final java.lang.String sWeeks

      The Constant sWeeks.

    - #### sDays

          public static final java.lang.String sDays

      The Constant sDays.

    - #### sHours

          public static final java.lang.String sHours

      The Constant sHours.

    - #### sMinutes

          public static final java.lang.String sMinutes

      The Constant sMinutes.

    - #### sSeconds

          public static final java.lang.String sSeconds

      The Constant sSeconds.

    - #### sNonstandard

          public static final java.lang.String sNonstandard

      The Constant sNonstandard.

    - #### unkownUnit

          public static final javax.xml.namespace.QName unkownUnit

      The Constant unkownUnit.

    - #### notesOrderer

          public static com.ihr.xbrl.dts.InstanceExplorerAbstract.ClsNotesOrderer notesOrderer

      The notes orderer.

  - ### Method Detail

    - #### instanceEvent

          public void instanceEvent(InstanceExplorerEvent e)

      Description copied from interface: `InstanceExplorerListener`
      Instance event.
      Specified by:
        `instanceEvent` in interface `InstanceExplorerListener`
      Parameters:
        `e` - the e

    - #### indexOfDateStepCode

          public static int indexOfDateStepCode(int dateStep)

      Return the index of the dateStep code in the internally ordered array of dateStep codes.
      Parameters:
        `dateStep` - the date step
      Returns:
        integer

    - #### stepsCodeForIndex

          public static int stepsCodeForIndex(int index)

      Access to the dateStep code corresponding to the index in the sequence. YEARS = 0 ... SECONDS = Biggest index
      Parameters:
        `index` - the index
      Returns:
        integer

    - #### stringTokenToInt

          public static int stringTokenToInt(java.lang.String dateStep)

      Transform a string representation of a token for a period into the corresponding integer value.

      The integer value is an index over a tale of dateSteps ordered by duration.

      Parameters:
        `dateStep` - String like "years", "halves", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds"
      Returns:
        integer value of the string token

    - #### intTokenToString

          public static java.lang.String intTokenToString(int dateStep)

      Converts an integer value into the string representation See: `intTokenToString(int)` for more information.
      Parameters:
        `dateStep` - integer
      Returns:
        String token

    - #### getNumTokens

          public static int getNumTokens()

      Returns the number of tokens that represents column types by the column range. Years, Halves, Querters, ... Seconds
      Returns:
        integer

    - #### getNumberOfCompanies

          public int getNumberOfCompanies()

      Access to the number of different companies this instance have stored information .
      Returns:
        integer

    - #### getCompanyKeys

          public java.util.Iterator<CompanyKey> getCompanyKeys()

      Access to an iterator over the keys for company data.
      Specified by:
        `getCompanyKeys` in interface `InstanceExplorerInterface`
      Returns:
        Iterator<InstanceExplorer.CompanyKey>

    - #### getStringOfPeriod

          public static java.lang.String getStringOfPeriod(XBRLPeriod period)

      Returns text representation of an XBRLPeriod that is suitable for GUIs.
      Parameters:
        `period` - the period
      Returns:
        the string of period

    - #### getStringOfDateStep

          public static java.lang.String getStringOfDateStep(java.util.GregorianCalendar dateStart,
                                             java.util.GregorianCalendar dateEnd,
                                             int dateStep)

      Gets the string of date step.
      Parameters:
        `dateStart` - start date o the period
        `dateEnd` - end date of the period
        `dateStep` - the date step
      Returns:
        String

    - #### addInstanceExplorerListener

          public static void addInstanceExplorerListener(InstanceExplorerListener l)

      Adds the instance explorer listener.
      Parameters:
        `l` - the l

    - #### removeInstanceExplorerListener

          public static void removeInstanceExplorerListener(InstanceExplorerListener l)

      Removes the instance explorer listener.
      Parameters:
        `l` - the l

    - #### getInstanceExplorerListeners

          public static InstanceExplorerListener[] getInstanceExplorerListeners()

      Gets the instance explorer listeners.
      Returns:
        Array of listeners of type InstanceExplorerListener

    - #### sendEvent

          public static void sendEvent(InstanceExplorerEvent event)

      Send event.
      Parameters:
        `event` - the event

    - #### clear

          public void clear()

      Description copied from interface: `InstanceExplorerInterface`
      Clear.
      Specified by:
        `clear` in interface `InstanceExplorerInterface`

    - #### getVNotes

          public java.util.Iterator<VNotes> getVNotes()

      Gets the v notes.
      Returns:
        the v notes

    - #### getFactNotes

          public VNotes getFactNotes(XBRLFact fact)

      Gets the fact notes.
      Parameters:
        `fact` - the fact
      Returns:
        the fact notes

    - #### getSuggestedUnits

          public java.util.Iterator<XBRLUnit> getSuggestedUnits(XBRLItem itm)

      Implementation of the UnitsProvider interface The algorithm considers other units in this report and put first the "suggested unit" for this fact item.
      Specified by:
        `getSuggestedUnits` in interface `UnitsProvider`
      Parameters:
        `itm` - the itm
      Returns:
        the suggested units

    - #### getSuggestedUnit

          public XBRLUnit getSuggestedUnit(CompanyKey ck,
                                  XBRLItem itm)

      Returns a suggested unit for a numeric concept definition. The answer will be based on existing information in the instance. If the instance already has a fact item for the same concept definition the same unit will be suggested.

      If there are no results like this then the Local Country ISO is returned for monetary item types, xbrli:pure is returned for pure item types and xbrli:shares is returned for shares item types. In any other case the QName {http://www.reportingstandard.com/userDefinedUnits}unkownUnit is returned

      Specified by:
        `getSuggestedUnit` in interface `InstanceExplorerInterface`
      Parameters:
        `ck` - the ck
        `itm` - the itm
      Returns:
        XBRLUnit

    - #### setSuggestedUnit

          public void setSuggestedUnit(XBRLItem item,
                              CompanyKey ck,
                              XBRLUnit unit)

      Sets the suggested unit.
      Parameters:
        `item` - the item
        `ck` - the ck
        `unit` - the unit

    - #### hasDataForCompany

          public boolean hasDataForCompany(CompanyKey ck)

      Checks for data for company.
      Specified by:
        `hasDataForCompany` in interface `InstanceExplorerInterface`
      Parameters:
        `ck` - the ck
      Returns:
        boolean