XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Class DomainImpl

java.lang.Object
  extended by org.xbrlapi.aspects.DomainImpl
All Implemented Interfaces:
Serializable, Comparator<AspectValue>, Domain, StoreHandler
Direct Known Subclasses:
ConceptDomain, DimensionDomainImpl, EntityDomain, LocationDomain, PeriodDomain, ScenarioDomain, ScenarioRemainderDomain, SegmentDomain, SegmentRemainderDomain, TupleDomain, UnitDomain

public abstract class DomainImpl
extends Object
implements Domain, StoreHandler

See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
DomainImpl(Store store)
           
 
Method Summary
 boolean allowsMissingValues()
          This method is implemented by each concrete domain class.
 List<AspectValue> getAllAspectValues()
           
 List<AspectValue> getChildren(AspectValue parent)
           
 int getDepth(AspectValue aspectValue)
           
 AspectValue getParent(AspectValue child)
           
 long getSize()
           
 Store getStore()
           
 boolean hasChildren(AspectValue value)
           
 boolean hasParent(AspectValue child)
           
 boolean isFinite()
          The getSize() and the getAllAspectValues methods must only be implemented if this method returns true.
 boolean isRoot(AspectValue aspectValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xbrlapi.aspects.Domain
getAspectId, isInDomain
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

DomainImpl

public DomainImpl(Store store)
           throws XBRLException
Throws:
XBRLException
Method Detail

getStore

public Store getStore()
               throws XBRLException
Specified by:
getStore in interface StoreHandler
Returns:
the underlying data store.
Throws:
XBRLException
See Also:
StoreHandler.getStore()

getAllAspectValues

public List<AspectValue> getAllAspectValues()
                                     throws XBRLException
Specified by:
getAllAspectValues in interface Domain
Returns:
a list of all of the aspect values in the domain except for the missing value. The list is ordered based on a depth first traversal of the aspect values in the domain. Thus, parent values come immediately before their child values and child values are sorted by their strict ordering if there is one.
Throws:
XBRLException
See Also:
Domain.getAllAspectValues()

getChildren

public List<AspectValue> getChildren(AspectValue parent)
                              throws XBRLException
Specified by:
getChildren in interface Domain
Parameters:
parent - The parent aspect value.
Returns:
the ordered list of child aspect values for the given parent aspect value. The list is empty if there are no child aspect values in the domain for the given parent aspect value.
Throws:
XBRLException
See Also:
Domain.getChildren(AspectValue)

getDepth

public int getDepth(AspectValue aspectValue)
             throws XBRLException
Specified by:
getDepth in interface Domain
Parameters:
aspectValue - The aspect value whose ancestor aspect values are to be counted.
Returns:
the number of ancestor aspect values that this aspect value has in this domain. The return value will be zero if the domain does not define a heirarchical ordering of aspect values.
Throws:
XBRLException
See Also:
Domain.getDepth(AspectValue)

getParent

public AspectValue getParent(AspectValue child)
                      throws XBRLException
Specified by:
getParent in interface Domain
Parameters:
child - The aspect value.
Returns:
the parent aspect value.
Throws:
XBRLException - if the aspect value does not have a parent.
See Also:
Domain.getParent(AspectValue)

getSize

public long getSize()
             throws XBRLException
Specified by:
getSize in interface Domain
Returns:
the number of aspect values in the domain or null if the domain size is infinite.
Throws:
XBRLException
See Also:
Domain.getSize()

hasChildren

public boolean hasChildren(AspectValue value)
                    throws XBRLException
Specified by:
hasChildren in interface Domain
Parameters:
value - The aspect value.
Returns:
true if the aspect value has child aspect values and false otherwise.
Throws:
XBRLException
See Also:
Domain.hasChildren(AspectValue)

hasParent

public boolean hasParent(AspectValue child)
                  throws XBRLException
Specified by:
hasParent in interface Domain
Parameters:
child - The child aspect value.
Returns:
true if this aspect value has a parent aspect value in the aspect model and false otherwise.
Throws:
XBRLException
See Also:
Domain.hasParent(AspectValue)

isFinite

public boolean isFinite()
Description copied from interface: Domain
The getSize() and the getAllAspectValues methods must only be implemented if this method returns true. Otherwise they need to throw an exception.

Specified by:
isFinite in interface Domain
Returns:
true if the domain has a finite number of members in it and false otherwise.
See Also:
Domain.isFinite()

isRoot

public boolean isRoot(AspectValue aspectValue)
               throws XBRLException
Specified by:
isRoot in interface Domain
Parameters:
aspectValue - The aspect value to test.
Returns:
true if and only if the aspect value has depth of zero.
Throws:
XBRLException
See Also:
Domain.isRoot(AspectValue)

allowsMissingValues

public boolean allowsMissingValues()
Description copied from interface: Domain
This method is implemented by each concrete domain class.

Specified by:
allowsMissingValues in interface Domain
Returns:
true if the domain allows missing values and false otherwise.
See Also:
Domain.allowsMissingValues()

Get Java XBRL API implementation at SourceForge.net.