|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ihr.xbrl.dts.InstanceExplorerAbstract
com.ihr.xbrl.dts.InstanceExplorer
public class InstanceExplorer
This class provides methods to investigate the content of an XBRL instance document from a high level point of view so the development of tools reading the content of instance document will be much easier
| Field Summary |
|---|
| Fields inherited from class com.ihr.xbrl.dts.InstanceExplorerAbstract |
|---|
DAYS, FOREVER, HALVES, HOURS, MINUTES, MONTHS, NONSTANDARD, notesOrderer, QUARTERS, sDays, SECONDS, sForever, sHalves, sHours, sMinutes, sMonths, sNonstandard, sQuarters, sSeconds, sWeeks, sYears, unkownUnit, WEEKS, YEARS |
| Constructor Summary | |
|---|---|
InstanceExplorer(LangsProvider lp,
HasBoySupport hb,
NegatedSupport ns,
DefaultUnitProviderInterface defaultUnitProvider)
|
|
| Method Summary | |
|---|---|
void |
addColumn(CompanyKey ck,
ColumnPeriod col)
|
void |
addContext(XBRLContext newContext,
int dateStep)
Adds a new context to this context provider. |
void |
addFact(XBRLFact fact)
Receives notification a fact has been added to the instance being explored |
void |
clear()
|
void |
delColumn(CompanyKey ck,
ColumnPeriod col)
|
void |
delContext(XBRLContext ctx)
Removing a context requires removing all facts using the context. |
void |
delFact(XBRLFact fact,
XBRLFactsList parent)
Announces a fact has been removed from the instance being explored. |
void |
factChangedContext(XBRLFactItem fact,
XBRLContext oldContext,
XBRLContext newContext)
Informs the Context provider that the fact has changed its context information. |
void |
factChangedUnit(XBRLFactNumeric fact,
XBRLUnit oldUnit,
XBRLUnit newUnit)
|
XBRLFactItem |
findFact(java.util.ArrayList<Member<?>> allMembers)
if the allMembers contains LineTitleMember elements, we need to resolve the hierarchy resolution before calling this method. |
static java.util.GregorianCalendar |
gcCloneAndAdd(java.util.GregorianCalendar initial,
int dateStep,
boolean bSignIsPlus)
Helper method to calculate the date end as a copy of the initial date and an amount of time since then |
java.util.Collection<XBRLContext> |
getAllContexts(CompanyKey ck,
XBRLItem.PeriodType periodType)
Access to a collection of all contexts that are associated with factColumns in this InstanceExplorer. |
java.util.Collection<XBRLUnit> |
getAllUnits(CompanyKey ck,
XBRLItem item)
Returns all the units in the instance document that are used by the company indicated by the CompanyKey parameter. |
ColumnPeriod |
getColumn(CompanyKey ck,
int index,
int dateStep)
|
java.util.Iterator<ColumnPeriod> |
getColumnKeysIterator(CompanyKey ck,
int dateStep)
|
int[] |
getColumnsCount(CompanyKey ck,
int dateStep,
java.util.Collection<XMLElementDefinition> concepts,
boolean bSkipEmptyColumns)
Returns an array of indexes of columns with data for the list of concepts in the concepts parameter. |
java.util.Iterator<XBRLContext> |
getCompatibleContexts(XBRLFactItem fact,
int dateStep)
Returns an iterator over compatible contexts for this fact. |
int |
getDateStepForFact(XBRLFactItem item,
int dateStep)
Prepares a dateStep depending on the contextual information of the fact. |
java.util.Iterator<java.lang.String> |
getDateStepIterator(CompanyKey ck,
int dateStep)
|
int |
getDateStepNumKeys(CompanyKey ck,
int dateStep)
|
FactsColumn |
getFactsColumn(CompanyKey ck,
ColumnPeriod period,
int dateStep)
This is never null. |
int |
getMaxGranularityCode()
|
static java.lang.String |
getStringOfDateStep(XBRLPeriod period,
int dateStep,
HasBoySupport hb)
|
java.util.Vector<XBRLContext> |
getVectorForKey(CompanyKey ck,
java.lang.String keyContexts,
int dateStep)
Access to a Vector of XBRLContexts |
void |
instanceEvent(InstanceExplorerEvent e)
|
static java.lang.String |
instanceModeToString(HandleDateStep.InstantMode instantMode)
|
static XBRLPeriod |
makePeriod(XBRLItem.PeriodType periodType,
int dateStep,
DTSContainer dts)
Creates a period of a specified period type (Instant or Duration) and sets the values according to the dateStep value. |
void |
processContexts(java.util.Iterator<XBRLContext> contexts)
|
void |
setInstance(XBRLInstance instance)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InstanceExplorer(LangsProvider lp,
HasBoySupport hb,
NegatedSupport ns,
DefaultUnitProviderInterface defaultUnitProvider)
| Method Detail |
|---|
public int getMaxGranularityCode()
public void setInstance(XBRLInstance instance)
public java.util.Vector<XBRLContext> getVectorForKey(CompanyKey ck,
java.lang.String keyContexts,
int dateStep)
ck - keyContexts - dateStep -
public FactsColumn getFactsColumn(CompanyKey ck,
ColumnPeriod period,
int dateStep)
ck - period - dateStep -
public java.util.Iterator<java.lang.String> getDateStepIterator(CompanyKey ck,
int dateStep)
dateStep -
javax.xml.transform.TransformerException
InstanceExplorerRuntimeException
public java.util.Iterator<ColumnPeriod> getColumnKeysIterator(CompanyKey ck,
int dateStep)
public int getDateStepNumKeys(CompanyKey ck,
int dateStep)
public int[] getColumnsCount(CompanyKey ck,
int dateStep,
java.util.Collection<XMLElementDefinition> concepts,
boolean bSkipEmptyColumns)
If the concepts parameter is null, the returned array contains all columns, one index per column
The number of elements in the array is the number of columns
If there is no data for the company the function returns an empty array
ck - company keydateStep - dateStep to considerconcepts - is a Collection of concepts to filter. if null all concepts are selected.
public ColumnPeriod getColumn(CompanyKey ck,
int index,
int dateStep)
public static java.util.GregorianCalendar gcCloneAndAdd(java.util.GregorianCalendar initial,
int dateStep,
boolean bSignIsPlus)
initial - GregorianCalendardateStep - constant indicating the period duration. This constant corresponds with GregorianCalendar defined fields extended by
constants defined in InstanceExplorerAbstract classbSignIsPlus - boolean true means positive period false means negative period
public static java.lang.String getStringOfDateStep(XBRLPeriod period,
int dateStep,
HasBoySupport hb)
period - XBRLPerioddateStep -
public static java.lang.String instanceModeToString(HandleDateStep.InstantMode instantMode)
instantMode -
public void processContexts(java.util.Iterator<XBRLContext> contexts)
public java.util.Collection<XBRLContext> getAllContexts(CompanyKey ck,
XBRLItem.PeriodType periodType)
Access to a collection of all contexts that are associated with factColumns in this InstanceExplorer. And are of the specified context type.
The returned collection is ordered from the lowest date to the highest date.
If periodType is XBRLItem.UNDEFINED_PERIOD_TYPE then all context are included
ck - periodType -
public java.util.Iterator<XBRLContext> getCompatibleContexts(XBRLFactItem fact,
int dateStep)
ContextProvider
public void addContext(XBRLContext newContext,
int dateStep)
ContextProvider
newContext - XBRLContext to adddateStep - the value of the dateStep container for the new contextpublic void delContext(XBRLContext ctx)
This process is independent from removing the context from the instance document
ctx - public void addFact(XBRLFact fact)
fact -
public void delFact(XBRLFact fact,
XBRLFactsList parent)
Note: after removing a fact from its container the fact parent is set to null.
The fact has to be removed from the parent container prior to call this method and this is the reason this method has a second parameter that indicated what the parent container was.
fact - parent -
public void delColumn(CompanyKey ck,
ColumnPeriod col)
ck - col -
public void addColumn(CompanyKey ck,
ColumnPeriod col)
ck - col -
public java.util.Collection<XBRLUnit> getAllUnits(CompanyKey ck,
XBRLItem item)
ck -
public static XBRLPeriod makePeriod(XBRLItem.PeriodType periodType,
int dateStep,
DTSContainer dts)
Creates a period of a specified period type (Instant or Duration) and sets the values according to the dateStep value.
For instant periods bigger than days the instant time is set to 24 hours before of the lowest time where today's date is in the dateStep period
For instant periods lower than days the instant time is set to the time of the lowest time where today's date is in the dateStep period. Minutes, seconds are set to 0 to indicate the non required precision.
For periods, the start date and end date is indicating the beginning and ending period time under the range specified by dateStep
periodType - dateStep - dts - DTSContainer
public void factChangedContext(XBRLFactItem fact,
XBRLContext oldContext,
XBRLContext newContext)
ContextProvider
public void factChangedUnit(XBRLFactNumeric fact,
XBRLUnit oldUnit,
XBRLUnit newUnit)
public int getDateStepForFact(XBRLFactItem item,
int dateStep)
item - the XBRLFactItemdateStep - suggested value for date step
public void clear()
clear in interface InstanceExplorerInterfaceclear in class InstanceExplorerAbstractpublic XBRLFactItem findFact(java.util.ArrayList<Member<?>> allMembers)
InstanceExplorerInterface
public void instanceEvent(InstanceExplorerEvent e)
instanceEvent in interface InstanceExplorerListenerinstanceEvent in class InstanceExplorerAbstract
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||