XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Interface Domain

All Superinterfaces:
Comparator<AspectValue>, Serializable, StoreHandler
All Known Implementing Classes:
ConceptDomain, DimensionDomainImpl, DomainImpl, EntityDomain, ExplicitDimensionDomain, LocationDomain, PeriodDomain, ScenarioDomain, ScenarioRemainderDomain, SegmentDomain, SegmentRemainderDomain, TupleDomain, TypedDimensionDomain, UnitDomain

public interface Domain
extends StoreHandler, Serializable, Comparator<AspectValue>

Domain

A domain represents a collection of values for a single aspect, which may have a strict heirarchical ordering.

The extent of the domain is determined by its definition. All domain definitions include the aspect identifier because a domain must only contain aspect values that are values for the same aspect.

Domain definitions allow testing of aspect values to determine if they are part of the domain or not. They also allow analysis of heirarchical relationships between the aspect values in the domain, if such heirarchial relationships exist.

Domain definitions can be established in any number of ways, including but not restricted to:

Author:
Geoff Shuetrim (geoff@galexy.net)

Method Summary
 boolean allowsMissingValues()
          This method is implemented by each concrete domain class.
 List<AspectValue> getAllAspectValues()
           
 URI getAspectId()
           
 List<AspectValue> getChildren(AspectValue parent)
           
 int getDepth(AspectValue aspectValue)
           
 AspectValue getParent(AspectValue child)
           
 long getSize()
           
 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 isInDomain(AspectValue candidate)
           
 boolean isRoot(AspectValue aspectValue)
           
 
Methods inherited from interface org.xbrlapi.aspects.StoreHandler
getStore
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Method Detail

getAspectId

URI getAspectId()
Returns:
the URI identifying the aspect that this is a domain for.

hasChildren

boolean hasChildren(AspectValue value)
                    throws XBRLException
Parameters:
value - The aspect value.
Returns:
true if the aspect value has child aspect values and false otherwise.
Throws:
XBRLException

getChildren

List<AspectValue> getChildren(AspectValue parent)
                              throws XBRLException
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

hasParent

boolean hasParent(AspectValue child)
                  throws XBRLException
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

getParent

AspectValue getParent(AspectValue child)
                      throws XBRLException
Parameters:
child - The aspect value.
Returns:
the parent aspect value.
Throws:
XBRLException - if the aspect value does not have a parent.

getDepth

int getDepth(AspectValue aspectValue)
             throws XBRLException
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

isRoot

boolean isRoot(AspectValue aspectValue)
               throws XBRLException
Parameters:
aspectValue - The aspect value to test.
Returns:
true if and only if the aspect value has depth of zero.
Throws:
XBRLException

getAllAspectValues

List<AspectValue> getAllAspectValues()
                                     throws XBRLException
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

getSize

long getSize()
             throws XBRLException
Returns:
the number of aspect values in the domain or null if the domain size is infinite.
Throws:
XBRLException

isInDomain

boolean isInDomain(AspectValue candidate)
                   throws XBRLException
Parameters:
candidate - The candidate aspect value.
Returns:
true if the aspect value is in the domain and false otherwise.
Throws:
XBRLException

isFinite

boolean isFinite()
The getSize() and the getAllAspectValues methods must only be implemented if this method returns true. Otherwise they need to throw an exception.

Returns:
true if the domain has a finite number of members in it and false otherwise.

allowsMissingValues

boolean allowsMissingValues()
This method is implemented by each concrete domain class.

Returns:
true if the domain allows missing values and false otherwise.

Get Java XBRL API implementation at SourceForge.net.