XBRLAPI

A Java API for XBRL


org.xbrlapi.impl
Class InstanceImpl

java.lang.Object
  extended by org.xbrlapi.impl.XMLImpl
      extended by org.xbrlapi.impl.FragmentImpl
          extended by org.xbrlapi.impl.InstanceImpl
All Implemented Interfaces:
Serializable, Comparable<XML>, Fragment, Instance, XML

public class InstanceImpl
extends FragmentImpl
implements Instance

Author:
Geoffrey Shuetrim (geoff@galexy.net)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xbrlapi.impl.XMLImpl
logger
 
Constructor Summary
InstanceImpl()
           
 
Method Summary
 List<Concept> getAllConcepts()
           
 long getAllConceptsCount()
           
 List<Fact> getAllFacts()
           
 long getAllFactsCount()
           
 List<Item> getAllItems()
           
 List<Concept> getChildConcepts()
           
 long getChildConceptsCount()
           
 List<Fact> getChildFacts()
          Get the list of facts that are children of the instance.
 long getChildFactsCount()
           
 List<Item> getChildItems()
           
 Context getContext(String id)
          Get a specified context from the instance based on its id.
 List<Context> getContexts()
          Get list contexts contained in the instance.
 String getEarliestPeriod()
           
 Map<String,Set<String>> getEntityIdentifiers()
           
 List<EntityResource> getEntityResources()
           
 List<Fact> getFacts(Concept concept)
           
 List<Fact> getFacts(URI namespace, String localname)
           
 List<ExtendedLink> getFootnoteLinks()
          Get a list of footnote link fragments Returns null if none are contained by the XBRL instance.
 List<FootnoteResource> getFootnotes()
           
 String getLatestPeriod()
           
 List<SimpleLink> getLinkbaseRefs()
          Get the list of linkbaseRef fragments in the instance Returns null if none are contained by the XBRL instance.
 List<SimpleLink> getSchemaRefs()
          Get the list of schemaRef fragments in the instance Returns null if none are contained by the XBRL instance.
 List<Tuple> getTuples()
           
 Unit getUnit(String id)
          Get a specified unit from the instance based on its id.
 List<Unit> getUnits()
          Get the list of units contained in the instance.
 
Methods inherited from class org.xbrlapi.impl.FragmentImpl
appendElementSchemeXPointer, appendID, getAllChildren, getAllChildrenIndices, getAncestorOrSelf, getChild, getChildren, getChildren, getChildrenIndices, getDataRootElement, getElementSchemeXPointerExpression, getIDXPointerExpression, getLabels, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithLanguageAndResourceRole, getLabelsWithLanguageAndResourceRoleAndLinkRole, getLabelsWithResourceRole, getLanguage, getLanguage, getLanguageName, getLanguageName, getLocalname, getLocalnameFromQName, getNamespace, getNamespaceFromQName, getParent, getParentElement, getParentIndex, getPrefixFromQName, getReferences, getReferencesWithLanguage, getReferencesWithLanguageAndResourceRoleAndLinkRole, getReferencesWithLanguageAndRole, getReferencesWithResourceRole, getReferencingLocators, getSequenceToParentElement, getSequenceToParentElementAsString, getSimpleLinks, getURI, getXPath, getXPointerExpression, isAncestorOf, isChild, isNewFragment, isRoot, setParentIndex, setSequenceToParentElement, setURI
 
Methods inherited from class org.xbrlapi.impl.XMLImpl
appendMetadataElement, compareTo, equals, finalize, getBuilder, getDocumentNode, getIndex, getMetaAttribute, getMetadataRootElement, getStore, getType, hashCode, hasMetaAttribute, isa, isa, removeMetaAttribute, removeMetadataElement, serialize, serialize, serialize, setBuilder, setIndex, setMetaAttribute, setResource, setStore, updateInStore
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xbrlapi.Fragment
appendElementSchemeXPointer, appendID, getAllChildren, getAllChildrenIndices, getAncestorOrSelf, getChild, getChildren, getChildren, getChildrenIndices, getDataRootElement, getElementSchemeXPointerExpression, getIDXPointerExpression, getLabels, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithLanguageAndResourceRole, getLabelsWithLanguageAndResourceRoleAndLinkRole, getLabelsWithResourceRole, getLanguage, getLanguage, getLanguageName, getLanguageName, getLocalname, getLocalnameFromQName, getNamespace, getNamespaceFromQName, getParent, getParentElement, getParentIndex, getPrefixFromQName, getReferences, getReferencesWithLanguage, getReferencesWithLanguageAndResourceRoleAndLinkRole, getReferencesWithLanguageAndRole, getReferencesWithResourceRole, getReferencingLocators, getSequenceToParentElement, getSequenceToParentElementAsString, getSimpleLinks, getURI, getXPath, getXPointerExpression, isAncestorOf, isChild, isNewFragment, isRoot, setParentIndex, setSequenceToParentElement, setURI
 
Methods inherited from interface org.xbrlapi.XML
appendMetadataElement, equals, getBuilder, getDocumentNode, getIndex, getMetaAttribute, getMetadataRootElement, getStore, getType, hashCode, hasMetaAttribute, isa, isa, removeMetaAttribute, removeMetadataElement, serialize, serialize, serialize, setBuilder, setIndex, setMetaAttribute, setResource, setStore, updateInStore
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

InstanceImpl

public InstanceImpl()
Method Detail

getSchemaRefs

public List<SimpleLink> getSchemaRefs()
                               throws XBRLException
Description copied from interface: Instance
Get the list of schemaRef fragments in the instance Returns null if none are contained by the XBRL instance.

Specified by:
getSchemaRefs in interface Instance
Throws:
XBRLException
See Also:
Instance.getSchemaRefs()

getLinkbaseRefs

public List<SimpleLink> getLinkbaseRefs()
                                 throws XBRLException
Description copied from interface: Instance
Get the list of linkbaseRef fragments in the instance Returns null if none are contained by the XBRL instance.

Specified by:
getLinkbaseRefs in interface Instance
Throws:
XBRLException
See Also:
Instance.getLinkbaseRefs()

getContexts

public List<Context> getContexts()
                          throws XBRLException
Description copied from interface: Instance
Get list contexts contained in the instance. Returns null if none are contained by the XBRL instance.

Specified by:
getContexts in interface Instance
Throws:
XBRLException
See Also:
Instance.getContexts()

getContext

public Context getContext(String id)
                   throws XBRLException
Description copied from interface: Instance
Get a specified context from the instance based on its id.

Specified by:
getContext in interface Instance
Parameters:
id - The id of the context fragment
Returns:
the context fragment
Throws:
XBRLException - if the context does not exist
See Also:
Instance.getContext(String)

getUnits

public List<Unit> getUnits()
                    throws XBRLException
Description copied from interface: Instance
Get the list of units contained in the instance. Returns null if none are contained by the XBRL instance.

Specified by:
getUnits in interface Instance
Throws:
XBRLException
See Also:
Instance.getUnits()

getUnit

public Unit getUnit(String id)
             throws XBRLException
Description copied from interface: Instance
Get a specified unit from the instance based on its id.

Specified by:
getUnit in interface Instance
Parameters:
id - The id of the unit fragment
Returns:
the unit fragment
Throws:
XBRLException - if the unit is not in this instance.
See Also:
Instance.getUnit(String)

getFootnoteLinks

public List<ExtendedLink> getFootnoteLinks()
                                    throws XBRLException
Description copied from interface: Instance
Get a list of footnote link fragments Returns null if none are contained by the XBRL instance.

Specified by:
getFootnoteLinks in interface Instance
Throws:
XBRLException
See Also:
Instance.getFootnoteLinks()

getFootnotes

public List<FootnoteResource> getFootnotes()
                                    throws XBRLException
Specified by:
getFootnotes in interface Instance
Returns:
a list containing all of the footnote resources in the instance.
Throws:
XBRLException
See Also:
Instance.getFootnotes()

getChildFacts

public List<Fact> getChildFacts()
                         throws XBRLException
Description copied from interface: Instance
Get the list of facts that are children of the instance. Facts that are within tuples are not included in this list.

Specified by:
getChildFacts in interface Instance
Returns:
the list of facts that are children of the instance.
Throws:
XBRLException
See Also:
Instance.getChildFacts()

getAllFacts

public List<Fact> getAllFacts()
                       throws XBRLException
Specified by:
getAllFacts in interface Instance
Returns:
all facts (tuples and facts within tuples also) in this instance.
Throws:
XBRLException
See Also:
Instance.getAllFacts()

getChildItems

public List<Item> getChildItems()
                         throws XBRLException
Specified by:
getChildItems in interface Instance
Returns:
the list of all items that are children of the instance. Tuples (and the items that they contain are not included in the list).
Throws:
XBRLException
See Also:
Instance.getChildItems()

getTuples

public List<Tuple> getTuples()
                      throws XBRLException
Specified by:
getTuples in interface Instance
Returns:
the list of tuples that are children of the instance. Tuples that are within tuples are not included in this list. The list is empty if the instance does not contain tuples.
Throws:
XBRLException
See Also:
Instance.getTuples()

getEarliestPeriod

public String getEarliestPeriod()
                         throws XBRLException
Specified by:
getEarliestPeriod in interface Instance
Returns:
the value of the earliest start date or instance in a context period in the XBRL instance. Returns null if the XBRL instance does not contain a context that does not have a value of forever.
Throws:
XBRLException
See Also:
Instance.getEarliestPeriod()

getChildFactsCount

public long getChildFactsCount()
                        throws XBRLException
Specified by:
getChildFactsCount in interface Instance
Returns:
the number of child facts in the instance (excludes facts that are contained within tuples).
Throws:
XBRLException
See Also:
Instance.getChildFactsCount()

getAllFactsCount

public long getAllFactsCount()
                      throws XBRLException
Specified by:
getAllFactsCount in interface Instance
Returns:
the number of facts in the instance including tuples and those facts within tuples.
Throws:
XBRLException
See Also:
Instance.getAllFactsCount()

getLatestPeriod

public String getLatestPeriod()
                       throws XBRLException
Specified by:
getLatestPeriod in interface Instance
Returns:
the value of the latest start date or instance in a context period in the XBRL instance. Returns null if the XBRL instance does not contain a context that does not have a value of forever.
Throws:
XBRLException
See Also:
Instance.getLatestPeriod()

getEntityResources

public List<EntityResource> getEntityResources()
                                        throws XBRLException
Specified by:
getEntityResources in interface Instance
Returns:
the list of entity resources for entities with facts in the instance.
Throws:
XBRLException
See Also:
Instance.getEntityResources()

getEntityIdentifiers

public Map<String,Set<String>> getEntityIdentifiers()
                                             throws XBRLException
Specified by:
getEntityIdentifiers in interface Instance
Returns:
A map, indexed by entity identifier schemes, of sets of the entity identifiers for those schemes, as contained in this XBRL instance.
Throws:
XBRLException
See Also:
Instance.getEntityIdentifiers()

getChildConcepts

public List<Concept> getChildConcepts()
                               throws XBRLException
Specified by:
getChildConcepts in interface Instance
Returns:
the list of concepts that have facts that are children of this XBRL instance (rather than being children of tuples).
Throws:
XBRLException
See Also:
Instance.getChildConcepts()

getAllConcepts

public List<Concept> getAllConcepts()
                             throws XBRLException
Specified by:
getAllConcepts in interface Instance
Returns:
the list of all concepts that have facts in this XBRL instance, including nested within tuples.
Throws:
XBRLException

getChildConceptsCount

public long getChildConceptsCount()
                           throws XBRLException
Specified by:
getChildConceptsCount in interface Instance
Returns:
the number of concepts that have facts that are children of this XBRL instance (rather than being nested within tuples).
Throws:
XBRLException
See Also:
Instance.getChildConceptsCount()

getAllConceptsCount

public long getAllConceptsCount()
                         throws XBRLException
Specified by:
getAllConceptsCount in interface Instance
Returns:
the number of concepts that have facts in this instance.
Throws:
XBRLException
See Also:
Instance.getAllConceptsCount()

getAllItems

public List<Item> getAllItems()
                       throws XBRLException
Specified by:
getAllItems in interface Instance
Returns:
the list of all items in the instance including those in tuples.
Throws:
XBRLException
See Also:
Instance.getAllItems()

getFacts

public List<Fact> getFacts(URI namespace,
                           String localname)
                    throws XBRLException
Specified by:
getFacts in interface Instance
Parameters:
namespace - The namespace of the facts to select.
localname - The local name of the facts to select.
Returns:
the list of facts in the instance with the given namespace and local name.
Throws:
XBRLException - if either parameter is null.
See Also:
Instance.getFacts(URI, String)

getFacts

public List<Fact> getFacts(Concept concept)
                    throws XBRLException
Specified by:
getFacts in interface Instance
Parameters:
concept - the concept to get the facts for.
Returns:
the list of facts in this instance that are reporting values for the specified concept.
Throws:
XBRLException - if the parameter is null.
See Also:
Instance.getFacts(Concept)

Get Java XBRL API implementation at SourceForge.net.