XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Interface Combinations

All Superinterfaces:
Serializable
All Known Implementing Classes:
CombinationsImpl

public interface Combinations
extends Serializable

Defines the methods that are available to interact with lists of aspects and lists of their values.

This object provides a range of functionality that assists with activities such as creating multilevel table row or column headings based upon combinations of aspect values.

Author:
Geoff Shuetrim (geoff@galexy.net)

Method Summary
 void clearAspectValues(URI aspectId)
          Removes the aspect values for the specified aspect.
 int getAncestorCount(URI aspectId)
           
 List<Aspect> getAspects()
           
 int getAspectValueCount(URI aspectId)
           
 List<AspectValue> getAspectValues(URI aspectId)
           
 String getAxis()
           
 int getCombinationCount()
           
 AspectValue getCombinationValue(URI aspectId, int combination)
          This method is useful when setting up filters for a specific combination of aspect values.
 Map<URI,AspectValue> getCombinationValues(int combination)
          This method is particularly useful in setting up fact set filtering based upon a combination of aspect values.
 int getDescendantCount(URI aspectId)
           
 boolean hasAspect(URI aspectId)
           
 void setAspectValues(FactSet factSet)
          For each aspect in the combination, its aspect values are set equal to the list of aspect values obtained from the fact set, sorted based on the comparator provided by the aspect's domain.
 void setAspectValues(URI aspectId, List<AspectValue> values)
           
 

Method Detail

getAxis

String getAxis()
Returns:
the axis of the model that this combinations object relates to.

getAspects

List<Aspect> getAspects()
Returns:
the ordered list of the underlying aspects.

hasAspect

boolean hasAspect(URI aspectId)
                  throws XBRLException
Parameters:
aspectId - The ID of the aspect of interest.
Returns:
true if the aspects in this combination include the one specified and false otherwise.
Throws:
XBRLException - if the aspect ID is null

getAspectValues

List<AspectValue> getAspectValues(URI aspectId)
                                  throws XBRLException
Parameters:
aspectId - The ID of the aspect of interest.
Returns:
the list of aspect values for the aspect of interest or the empty list of no aspect values have been set for the aspect of interest.
Throws:
XBRLException - if the combinations do not include the specified Aspect.

clearAspectValues

void clearAspectValues(URI aspectId)
                       throws XBRLException
Removes the aspect values for the specified aspect.

Parameters:
aspectId - The ID of the aspect of interest.
Throws:
XBRLException - if the combinations do not include the specified Aspect.

getAspectValueCount

int getAspectValueCount(URI aspectId)
                        throws XBRLException
Parameters:
aspectId - The ID of the aspect of interest.
Returns:
the number of values for the specified aspect
Throws:
XBRLException - if the combinations do not include the specified Aspect.

getAncestorCount

int getAncestorCount(URI aspectId)
                     throws XBRLException
Parameters:
aspectId - The ID of the aspect of interest.
Returns:
the number of unique combinations of values for the aspects that precede the aspect of interest in the list of aspects associated with this combination. This value is useful in determining the number of times that you need to iterate over the values for the aspect of interest when building up a set of table headings. The value is one if this aspect is the first in the list of aspects.
Throws:
XBRLException - if the combinations do not include the specified Aspect.

getDescendantCount

int getDescendantCount(URI aspectId)
                       throws XBRLException
Parameters:
aspectId - The ID of the aspect of interest.
Returns:
the number of unique combinations of values for the aspects that follow the aspect of interest in the list of aspects associated with this combination. This value is useful in determining the column or row span that you need for each value of the aspect of interest when building up a set of table headings. The value is 1 if there are no following aspects.
Throws:
XBRLException - if the combinations do not include the specified Aspect.

setAspectValues

void setAspectValues(URI aspectId,
                     List<AspectValue> values)
                     throws XBRLException
Parameters:
aspectId - The aspect whose values are being set.
values - The list of aspect values for the specified aspect.
Throws:
XBRLException - if a parameter is null or the aspect is not in the specified axis of the aspect model or if a value is for an aspect with an aspect ID that differs from the one provided as a parameter.

setAspectValues

void setAspectValues(FactSet factSet)
                     throws XBRLException
For each aspect in the combination, its aspect values are set equal to the list of aspect values obtained from the fact set, sorted based on the comparator provided by the aspect's domain.

Parameters:
factSet - set of facts to use when obtaining the aspect values.
Throws:
XBRLException - if the aspects parameter is null or the aspect is not in the specified axis of the aspect model.

getCombinationCount

int getCombinationCount()
Returns:
the total number of different combinations of aspect values.
Throws:
XBRLException

getCombinationValue

AspectValue getCombinationValue(URI aspectId,
                                int combination)
                                throws XBRLException
This method is useful when setting up filters for a specific combination of aspect values. The combinations are numbered from zero to the total number of combinations less one.

Parameters:
aspectId - The ID of the aspect that the value is being sought for.
combination - The index of the combination that an aspect value is being sought for.
Returns:
The value for the specified aspect in the specified combination.
Throws:
XBRLException

getCombinationValues

Map<URI,AspectValue> getCombinationValues(int combination)
                                          throws XBRLException
This method is particularly useful in setting up fact set filtering based upon a combination of aspect values.

Parameters:
combination - The index of the combination of aspect values to retrieve
Returns:
a map from aspect IDs to the values of those aspects for the specified combination.
Throws:
XBRLException

Get Java XBRL API implementation at SourceForge.net.