XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Interface AspectModel

All Superinterfaces:
Serializable
All Known Implementing Classes:
BaseAspectModel, DimensionalAspectModel, NonDimensionalAspectModel

public interface AspectModel
extends Serializable

Author:
Geoff Shuetrim (geoff@galexy.net)

Method Summary
 void addFact(Fact fact)
           
 void arrangeAspect(String aspectType, String axis)
           
 void arrangeAspect(String aspectType, String axis, String parentType)
           
 void clearAllCriteria()
          Clears all fact selection criteria in the aspect model.
 void clearFacts()
          Removes all facts from the aspect model and all aspect values from the aspects in the aspect models.
 void deleteAspect(String type)
           
 Set<Fact> getAllFacts()
           
 Aspect getAspect(String type)
           
 Collection<Aspect> getAspects()
           
 List<List<AspectValue>> getAspectValueCombinationsForAxis(String axis)
           
 List<AspectValue> getAspectValues(Fact fact)
           
 List<Aspect> getAxisAspects(String axis)
           
 Set<Fact> getFacts(Collection<AspectValue> values)
           
 Set<Fact> getMatchingFacts()
           
 List<List<AspectValue>> getMinimalAspectValueCombinationsForAxis(String axis)
           
 Collection<Aspect> getOrphanAspects()
           
 String getType()
           
 boolean hasAspect(String type)
           
 void setAspect(Aspect aspect)
           
 void setCriteria(Collection<AspectValue> criteria)
          Adds a collection of fact selection criteria.
 void setCriterion(AspectValue criterion)
          Adds a fact selection criterion used in selecting a set of the facts in the aspect model.
 

Method Detail

getType

String getType()
Returns:
The unique identifier of the aspect model.

getAspects

Collection<Aspect> getAspects()
Returns:
a Collection of the aspects in the aspect model.

getAspect

Aspect getAspect(String type)
                 throws XBRLException
Parameters:
type - the aspect type.
Returns:
the aspect with the specified aspect type.
Throws:
XBRLException - if the aspect model does not have the specified aspect.

hasAspect

boolean hasAspect(String type)
Parameters:
type - the aspect type.
Returns:
true if the aspect model includes the aspect with the specified aspect type and false otherwise.

getOrphanAspects

Collection<Aspect> getOrphanAspects()
Returns:
a collection of aspects that are not associated with a dimension, either as the root aspect for the dimension or as a descendant of another aspect associated with the dimension.

getAxisAspects

List<Aspect> getAxisAspects(String axis)
                            throws XBRLException
Parameters:
axis - The unique (for the aspect model) identifier for an axis of the aspect model. Aspect models can have zero or more axes, each of which has a root aspect. Root aspects can have a series of child aspects, all of which are aspects associated with the same axis of the aspect model. These axes are useful for relating aspects to rows and columns of a table, for example.
Returns:
the list of aspects for the axis.
Throws:
XBRLException - if the axis is not defined for the aspect model.

setAspect

void setAspect(Aspect aspect)
               throws XBRLException
Parameters:
aspect - The aspect to set in the aspect model, as an orphan.
Throws:
XBRLException

addFact

void addFact(Fact fact)
             throws XBRLException
Parameters:
fact - The fact to add to the aspect model
Throws:
XBRLException - if the fact cannot be added to the aspect model.

getAspectValues

List<AspectValue> getAspectValues(Fact fact)
                                  throws XBRLException
Parameters:
fact - The fact to get the aspect values for.
Returns:
a list of the aspect values (one for each aspect in the aspect model) for the supplied fact. The list is empty if the aspect model has no aspects.
Throws:
XBRLException

arrangeAspect

void arrangeAspect(String aspectType,
                   String axis)
                   throws XBRLException
Parameters:
aspectType - The type of aspect to arrange in the aspect model.
axis - the axis to put the aspect in, in last place in the ordering.
Throws:
XBRLException - if the aspect is not in the aspect model.

arrangeAspect

void arrangeAspect(String aspectType,
                   String axis,
                   String parentType)
                   throws XBRLException
Parameters:
aspectType - The type of aspect to arrange in the aspect model.
axis - the axis to put the aspect in.
parentType - The type of parent aspect for the aspect being set.
Throws:
XBRLException - if the aspect or parent are not in the aspect model.

getFacts

Set<Fact> getFacts(Collection<AspectValue> values)
                   throws XBRLException
Parameters:
values - is a collection of AspectValues to be matched.
Returns:
the set of all facts in the aspect model that match all of the aspect values to be matched.
Throws:
XBRLException

getAllFacts

Set<Fact> getAllFacts()
                      throws XBRLException
Returns:
the set of all facts in the aspect model.
Throws:
XBRLException

getMatchingFacts

Set<Fact> getMatchingFacts()
                           throws XBRLException
Returns:
The set of facts matching the selection criteria that have been added to the aspect model.
Throws:
XBRLException

setCriterion

void setCriterion(AspectValue criterion)
                  throws XBRLException
Adds a fact selection criterion used in selecting a set of the facts in the aspect model.

Parameters:
criterion - The aspect value that the selected facts must have.
Throws:
XBRLException
See Also:
getMatchingFacts()

setCriteria

void setCriteria(Collection<AspectValue> criteria)
                 throws XBRLException
Adds a collection of fact selection criteria.

Parameters:
criteria - The collection of aspect values that the selected facts must have.
Throws:
XBRLException
See Also:
getMatchingFacts(), setCriterion(AspectValue)

clearAllCriteria

void clearAllCriteria()
Clears all fact selection criteria in the aspect model.

See Also:
setCriterion(AspectValue), getMatchingFacts()

getAspectValueCombinationsForAxis

List<List<AspectValue>> getAspectValueCombinationsForAxis(String axis)
                                                          throws XBRLException
Parameters:
axis - The name of the axis
Returns:
a list of lists of aspect values where each list in the list is a combination of one aspect value for each aspect in the axis. The aspect values in each combination are ordered in the same order as the aspects in the axis. The lists in the list are ordered by the orderings of the values for each aspect.
Throws:
XBRLException

getMinimalAspectValueCombinationsForAxis

List<List<AspectValue>> getMinimalAspectValueCombinationsForAxis(String axis)
                                                                 throws XBRLException
Parameters:
axis - The name of the dimension
Returns:
a list of lists of aspect values where each list in the list is a combination of one aspect value for each aspect in the axis. The aspect values in each combination are ordered in the same order as the aspects in the axis. The lists in the list are ordered by the orderings of the values for each aspect. Any aspect that has just missing aspect values is omitted.
Throws:
XBRLException

deleteAspect

void deleteAspect(String type)
                  throws XBRLException
Parameters:
type - The type identifying the aspect to delete.
Throws:
XBRLException

clearFacts

void clearFacts()
                throws XBRLException
Removes all facts from the aspect model and all aspect values from the aspects in the aspect models. The aspects retain their maps from aspect value IDs to aspect value labels, however.

Throws:
XBRLException

Get Java XBRL API implementation at SourceForge.net. Fast, secure and Free Open Source software downloads