XBRLAPI

A Java API for XBRL


org.xbrlapi.aspects
Interface FactSet

All Superinterfaces:
Serializable
All Known Implementing Classes:
FactSetImpl

public interface FactSet
extends Serializable

Fact Set

A FactSet is a set of facts and a set of aspect values and a two-way mapping between the facts and the aspect values

The FactSet guarantees to have all aspect values for all of the facts that it contains. It also guarantees not to have any aspect values that are not values for facts in the fact set.

Author:
Geoff Shuetrim (geoff@galexy.net)

Method Summary
 void addFact(Fact fact)
          Adds the fact to the fact set, computing the aspect values for the fact for each aspect in the fact set's aspect model.
<F extends Fact>
void
addFacts(Collection<F> facts)
          Adds the facts to the fact set, computing the aspect values for the facts for each aspect in the fact set's aspect model.
 void emptyLocalLabelCache()
          This method simply empties the label cache that is a local property of the fact set.
 AspectModel getAspectModel()
           
 AspectValue getAspectValue(URI aspectId, Fact fact)
           
 int getAspectValueCount(URI aspectId)
           
 String getAspectValueLabel(AspectValue value, List<String> locales, List<URI> resourceRoles, List<URI> linkRoles)
          This is a convenience method to give access to the labels generated by the labellers for the values of each aspect in the fact set's aspect model.
 String getAspectValueLabel(AspectValue value, String locale, URI resourceRole, URI linkRole)
          This is a convenience method to give access to the labels generated by the labellers for the values of each aspect in the fact set's aspect model.
 Set<AspectValue> getAspectValues()
           
 Collection<AspectValue> getAspectValues(Fact fact)
           
 Collection<AspectValue> getAspectValues(URI aspectId)
           
 Set<Fact> getFacts()
           
 Set<Fact> getFacts(AspectValue value)
           
 Set<Fact> getFacts(Collection<AspectValue> values)
           
 AspectModel getModel()
           
 Collection<Aspect> getPopulatedAspects()
           
 List<Fact> getRootFacts(URI aspectId)
           
 long getSize()
           
 boolean hasAspectValue(AspectValue value)
           
 boolean hasFact(Fact fact)
           
 boolean isPopulated(URI aspectId)
           
 boolean isSingular(URI aspectId)
           
 

Method Detail

getModel

AspectModel getModel()
Returns:
the aspect model underpinning the fact set.

addFact

void addFact(Fact fact)
             throws XBRLException
Adds the fact to the fact set, computing the aspect values for the fact for each aspect in the fact set's aspect model.

Parameters:
fact - The fact to add.
Throws:
XBRLException

addFacts

<F extends Fact> void addFacts(Collection<F> facts)
              throws XBRLException
Adds the facts to the fact set, computing the aspect values for the facts for each aspect in the fact set's aspect model.

Parameters:
facts - The facts to add.
Throws:
XBRLException

hasFact

boolean hasFact(Fact fact)
Parameters:
fact - The fact to test for.
Returns:
true if the fact is in the set and false otherwise.

hasAspectValue

boolean hasAspectValue(AspectValue value)
Parameters:
value - The aspect value to test for.
Returns:
true if the aspect value is in the set and false otherwise.

getFacts

Set<Fact> getFacts()
Returns:
the set of all facts.

getAspectValues

Set<AspectValue> getAspectValues()
Returns:
the set of all aspect values.

getAspectValues

Collection<AspectValue> getAspectValues(URI aspectId)
Parameters:
aspectId - The ID of the aspect.
Returns:
the set of all values for the aspect, also always including the missing value.

getAspectValueCount

int getAspectValueCount(URI aspectId)
Parameters:
aspectId - The ID of the aspect.
Returns:
the number of non-missing aspect values for the given aspect.

isPopulated

boolean isPopulated(URI aspectId)
Parameters:
aspectId - The ID of the aspect.
Returns:
true if the fact set has non-missing values for the specified aspect.

isSingular

boolean isSingular(URI aspectId)
Parameters:
aspectId - The ID of the aspect.
Returns:
true if the fact set has only one non-missing values for the specified aspect.

getAspectValues

Collection<AspectValue> getAspectValues(Fact fact)
                                        throws XBRLException
Parameters:
fact - The fact.
Returns:
the set of aspect values for the given fact, including missing values for those aspects for which the fact does not have a value.
Throws:
XBRLException

getAspectValue

AspectValue getAspectValue(URI aspectId,
                           Fact fact)
                           throws XBRLException
Parameters:
aspectId - the ID of the aspect to get the aspect value for.
fact - The fact.
Returns:
the aspect value for the given fact and aspect.
Throws:
XBRLException

getFacts

Set<Fact> getFacts(AspectValue value)
Parameters:
value - The aspect value.
Returns:
the set of facts with the given aspect value.

getFacts

Set<Fact> getFacts(Collection<AspectValue> values)
Parameters:
values - The collection of aspect values that the returned facts must have.
Returns:
the set of facts that have all of the given aspect values.

getSize

long getSize()
Returns:
the number of facts in the fact set.

getAspectModel

AspectModel getAspectModel()
Returns:
the aspect model underpinning this fact set.

getRootFacts

List<Fact> getRootFacts(URI aspectId)
                        throws XBRLException
Parameters:
aspectId - The ID of the aspect of interest.
Returns:
a list of the facts in the fact set that have values for the specified aspect that are roots of the heirarchy of aspect values defined by the domain of the specified aspect.
Throws:
XBRLException

getPopulatedAspects

Collection<Aspect> getPopulatedAspects()
                                       throws XBRLException
Returns:
a collection of the populated aspects in the underlying aspect model. This leaves out all aspects that only have the missing value as their aspect value, for all facts in the fact set.
Throws:
XBRLException

getAspectValueLabel

String getAspectValueLabel(AspectValue value,
                           String locale,
                           URI resourceRole,
                           URI linkRole)
                           throws XBRLException
This is a convenience method to give access to the labels generated by the labellers for the values of each aspect in the fact set's aspect model. Labels are cached, based on the full set of information about the label selection criteria. The label cache, can be emptied.

Parameters:
value - The aspect value
locale - The label locale
resourceRole - The label XLink resource role
linkRole - The label link role
Returns:
the label for the given aspect value.
Throws:
XBRLException - if the aspect is not in the aspect model.

emptyLocalLabelCache

void emptyLocalLabelCache()
This method simply empties the label cache that is a local property of the fact set.


getAspectValueLabel

String getAspectValueLabel(AspectValue value,
                           List<String> locales,
                           List<URI> resourceRoles,
                           List<URI> linkRoles)
                           throws XBRLException
This is a convenience method to give access to the labels generated by the labellers for the values of each aspect in the fact set's aspect model.

Parameters:
value - The aspect value
locales - The list of label locales from first, most preferred to last, least preferred. The list can include nulls or it can be null.
resourceRoles - The list of label XLink resource roles from first, most preferred to last, least preferred. The list can include nulls or it can be null.
linkRoles - The label link role from first, most preferred to last, least preferred. The list can include nulls or it can be null.
Returns:
the label for the given aspect value.
Throws:
XBRLException - if the aspect is not in the aspect model.

Get Java XBRL API implementation at SourceForge.net.