public class CombinationsImpl extends java.lang.Object implements Combinations
This implementation requires a constructor that specifies the aspect model and the specific axis that the aspect value combinations will be required for. Thereafter, the list of values for each aspect must be set. How the list of aspect values is obtained is determined externally. It may be from a fact set or it may be from an aspect domain or it may be from a combination of the two. The ordering of aspect values is also determined externally to this object.
Constructor and Description |
---|
CombinationsImpl(AspectModel model,
java.lang.String axis)
The aspect value lists are initialised to a list containing a single missing value.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAspectValues(java.lang.String aspectId)
Removes the aspect values for the specified aspect.
|
int |
getAncestorCount(java.lang.String aspectId) |
java.util.List<Aspect> |
getAspects() |
int |
getAspectValueCount(java.lang.String aspectId) |
java.util.List<AspectValue> |
getAspectValues(java.lang.String aspectId) |
java.lang.String |
getAxis() |
int |
getCombinationCount() |
AspectValue |
getCombinationValue(java.lang.String aspectId,
int combination)
This method is useful when setting up filters for a specific combination
of aspect values.
|
java.util.Map<java.lang.String,AspectValue> |
getCombinationValues(int combination)
This method is particularly useful in setting up fact set filtering based
upon a combination of aspect values.
|
int |
getDescendantCount(java.lang.String aspectId) |
boolean |
hasAspect(java.lang.String 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(java.lang.String aspectId,
java.util.List<AspectValue> values) |
public CombinationsImpl(AspectModel model, java.lang.String axis) throws XBRLException
model
- The model containing the aspects and their arrangement into axes.axis
- The model axis to generate a combination for.XBRLException
- If the model does not have the specified axis.public int getAncestorCount(java.lang.String aspectId) throws XBRLException
getAncestorCount
in interface Combinations
aspectId
- The ID of the aspect of interest.XBRLException
- if the combinations do not include the specified Aspect.Combinations.getAncestorCount(String)
public boolean hasAspect(java.lang.String aspectId) throws XBRLException
hasAspect
in interface Combinations
aspectId
- The ID of the aspect of interest.XBRLException
- if the aspect ID is nullCombinations.hasAspect(String)
public void setAspectValues(java.lang.String aspectId, java.util.List<AspectValue> values) throws XBRLException
setAspectValues
in interface Combinations
aspectId
- The aspect whose values are being set.values
- The list of aspect values for the specified aspect.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.Combinations.setAspectValues(String, List)
public void clearAspectValues(java.lang.String aspectId) throws XBRLException
Combinations
clearAspectValues
in interface Combinations
aspectId
- The ID of the aspect of interest.XBRLException
- if the combinations do not include the specified Aspect.Combinations.clearAspectValues(String)
public int getAspectValueCount(java.lang.String aspectId) throws XBRLException
getAspectValueCount
in interface Combinations
aspectId
- The ID of the aspect of interest.XBRLException
- if the combinations do not include the specified Aspect.Combinations.getAspectValueCount(String)
public java.util.List<AspectValue> getAspectValues(java.lang.String aspectId) throws XBRLException
getAspectValues
in interface Combinations
aspectId
- The ID of the aspect of interest.XBRLException
- if the combinations do not include the specified Aspect.Combinations.getAspectValues(String)
public java.util.List<Aspect> getAspects()
getAspects
in interface Combinations
Combinations.getAspects()
public int getDescendantCount(java.lang.String aspectId) throws XBRLException
getDescendantCount
in interface Combinations
aspectId
- The ID of the aspect of interest.XBRLException
- if the combinations do not include the specified Aspect.Combinations.getDescendantCount(String)
public java.lang.String getAxis()
getAxis
in interface Combinations
Combinations.getAxis()
public int getCombinationCount()
getCombinationCount
in interface Combinations
Combinations.getCombinationCount()
public AspectValue getCombinationValue(java.lang.String aspectId, int combination) throws XBRLException
Combinations
getCombinationValue
in interface Combinations
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.XBRLException
Combinations.getCombinationValue(String, int)
public java.util.Map<java.lang.String,AspectValue> getCombinationValues(int combination) throws XBRLException
Combinations
getCombinationValues
in interface Combinations
combination
- The index of the combination of aspect values to retrieveXBRLException
Combinations.getCombinationValues(int)
public void setAspectValues(FactSet factSet) throws XBRLException
Combinations
setAspectValues
in interface Combinations
factSet
- set of facts to use when obtaining the aspect values.XBRLException
- if the aspects parameter is null or the aspect is not in the
specified axis of the aspect model.Combinations.setAspectValues(FactSet)