public class InstanceExplorer extends InstanceExplorerAbstract
ACUM_Q1Q3, ALL, DAYS, FREE, HALVES, HOURS, INSTANT, MINUTES, MONTHS, NONSTANDARD, notesOrderer, QUARTERS, QUARTERS4, sAcumQ1Q3, sDays, SECONDS, sForever, sHalves, sHours, sMinutes, sMonths, sNonstandard, sQuarters, sSeconds, sWeeks, sYears, unknownUnit, WEEKS, YEARS
Constructor and Description |
---|
InstanceExplorer(LangsProvider lp,
HasBoySupport hb,
NegatedSupport ns,
DefaultUnitProviderInterface defaultUnitProvider)
Instantiates a new instance explorer.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumn(CompanyKey ck,
ColumnPeriod col)
Adds the column.
|
void |
addContext(XBRLContext newContext)
Adds the context.
|
void |
addFact(XBRLFact fact)
Receives notification a fact has been added to the instance being explored.
|
void |
clear()
Clear.
|
void |
delColumn(CompanyKey ck,
ColumnPeriod col)
Del column.
|
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)
Fact changed context.
|
void |
factChangedUnit(XBRLFactNumeric fact,
XBRLUnit oldUnit,
XBRLUnit newUnit)
Fact changed unit.
|
XBRLFactItem |
findFact(java.util.Collection<Member<?>> allMembers)
Find fact.
|
XBRLFactItem |
findFact(java.util.Collection<Member<?>> allMembers,
java.util.List<InstanceExplorerEvent> lstEvents)
Find fact.
|
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)
Gets the column.
|
java.util.Iterator<ColumnPeriod> |
getColumnKeysIterator(CompanyKey ck)
Gets the column keys iterator.
|
int[] |
getColumnsCount(CompanyKey ck,
java.util.Collection<FactUse> 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)
Gets the compatible contexts.
|
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)
Gets the date step iterator.
|
int |
getDateStepNumKeys(CompanyKey ck)
Gets the date step num keys.
|
FactsColumn[] |
getFactsColumn(CompanyKey ck,
ColumnPeriod period,
boolean bIncludeRelated)
This is never null.
|
XBRLInstance |
getInstance()
Gets the single instance of InstanceExplorer.
|
int |
getMaxGranularityCode()
Gets the max granularity code.
|
java.util.List<XBRLContext> |
getVectorForKey(CompanyKey ck,
java.lang.String keyContexts)
Access to a Vector of XBRLContexts .
|
void |
instanceEvent(InstanceExplorerEvent e)
Instance event.
|
static java.lang.String |
instanceModeToString(HandleDateStep.InstantMode instantMode)
Instance mode to string.
|
static XBRLPeriod |
make(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)
Process contexts.
|
void |
setInstance(XBRLInstance instance)
Sets the instance.
|
void |
setNewColumns(boolean value)
Sets the new columns.
|
addInstanceExplorerListener, getCompanyKeys, getFactNotes, getInstanceExplorerListeners, getNumberOfCompanies, getNumTokens, getStringOfDateStep, getStringOfPeriod, getStringOfPeriod, getSuggestedUnit, getSuggestedUnits, getVNotes, hasDataForCompany, indexOfDateStepCode, intTokenToString, removeInstanceExplorerListener, sendEvent, setSuggestedUnit, stepsCodeForIndex, stringTokenToInt
public InstanceExplorer(LangsProvider lp, HasBoySupport hb, NegatedSupport ns, DefaultUnitProviderInterface defaultUnitProvider)
lp
- the lphb
- the hbns
- the nsdefaultUnitProvider
- the default unit providerpublic int getMaxGranularityCode()
public void setInstance(XBRLInstance instance)
instance
- the new instancepublic java.util.List<XBRLContext> getVectorForKey(CompanyKey ck, java.lang.String keyContexts)
ck
- the ckkeyContexts
- the key contextspublic FactsColumn[] getFactsColumn(CompanyKey ck, ColumnPeriod period, boolean bIncludeRelated)
ck
- the ckperiod
- the periodbIncludeRelated
- the b include relatedpublic java.util.Iterator<java.lang.String> getDateStepIterator(CompanyKey ck)
ck
- the ckpublic java.util.Iterator<ColumnPeriod> getColumnKeysIterator(CompanyKey ck)
ck
- the ckpublic int getDateStepNumKeys(CompanyKey ck)
ck
- the ckpublic int[] getColumnsCount(CompanyKey ck, java.util.Collection<FactUse> 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 keyconcepts
- is a Collection of concepts to filter. if null all concepts are selected.bSkipEmptyColumns
- the b skip empty columnspublic ColumnPeriod getColumn(CompanyKey ck, int index)
ck
- the ckindex
- the indexpublic 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 periodpublic static java.lang.String instanceModeToString(HandleDateStep.InstantMode instantMode)
instantMode
- the instant modepublic void processContexts(java.util.Iterator<XBRLContext> contexts)
contexts
- the contextspublic 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
- the ckperiodType
- the period typepublic java.util.Iterator<XBRLContext> getCompatibleContexts(XBRLFactItem fact)
fact
- the factpublic void addContext(XBRLContext newContext)
newContext
- the new contextpublic void delContext(XBRLContext ctx)
This process is independent from removing the context from the instance document
ctx
- the ctxpublic void addFact(XBRLFact fact)
fact
- the factpublic 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
- the factparent
- the parentpublic void delColumn(CompanyKey ck, ColumnPeriod col)
ck
- the ckcol
- the colpublic void addColumn(CompanyKey ck, ColumnPeriod col)
ck
- the ckcol
- the colpublic java.util.Collection<XBRLUnit> getAllUnits(CompanyKey ck, XBRLItem item)
ck
- the ckitem
- the itempublic static XBRLPeriod make(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
- the period typedateStep
- the date stepdts
- DTSContainerpublic void factChangedContext(XBRLFactItem fact, XBRLContext oldContext, XBRLContext newContext)
fact
- the factoldContext
- the old contextnewContext
- the new contextpublic void factChangedUnit(XBRLFactNumeric fact, XBRLUnit oldUnit, XBRLUnit newUnit)
fact
- the factoldUnit
- the old unitnewUnit
- the new unitpublic int getDateStepForFact(XBRLFactItem item, int dateStep)
item
- the XBRLFactItemdateStep
- suggested value for date steppublic void clear()
clear
in interface InstanceExplorerInterface
clear
in class InstanceExplorerAbstract
public XBRLFactItem findFact(java.util.Collection<Member<?>> allMembers)
allMembers
- the all memberspublic XBRLFactItem findFact(java.util.Collection<Member<?>> allMembers, java.util.List<InstanceExplorerEvent> lstEvents)
allMembers
- the all memberslstEvents
- the lst eventspublic void instanceEvent(InstanceExplorerEvent e)
instanceEvent
in interface InstanceExplorerListener
instanceEvent
in class InstanceExplorerAbstract
e
- the epublic XBRLInstance getInstance()
public void setNewColumns(boolean value)
value
- the new new columnsCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa