com.ihr.xbrl.om.formula
Class FContext

java.lang.Object
  extended by com.ihr.xbrl.om.formula.FContext

public class FContext
extends java.lang.Object

This is the Formula interpretation of the XBRL Segment or XBRL Scenario dimensions container of an XBRL context. This is different from the Dimensions model of the same information. This object holds the dimensional information and the non dimensional information nodes so the formula processor can work with them easily

Author:
Ignacio

Constructor Summary
FContext(XMLElementDefinition el)
           
FContext(XMLElementDefinition el, XBRLContext ctx)
           
 
Method Summary
 void add(XMLFragment fr, int container, boolean bIsOcc)
           
 void clear()
          Clears all dimensional and non dimensional information on this context.
 XMLFragment getDimension(javax.xml.namespace.QName dimName)
          Returns the dimension value associated to the dimension passed in in the dimName parameter.
 int getDimensionContainer(javax.xml.namespace.QName dimName)
           
 java.util.Collection<javax.xml.namespace.QName> getDimensions()
          Returns a collection of QNames for of all XDT dimensions explicitly written in the context, either in the segment or the scenario containers.
 java.util.Collection<XMLFragment> getNonDimensionalInformation(int container)
          Returns a collection of fragments with non dimensional information in the context container indicated in the parameter.
 XBRLDimensionsContainer getXBRLContext(int container)
          Converts the internal structures back to an XBRLContext object.
static boolean isExplicitDimensionContainer(XMLFragment fragment)
          returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions
static boolean isTypedDimensionContainer(XMLFragment fragment)
          returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions
 void remove(XMLFragment fr, int container, boolean bIsOcc)
           
 void removeDim(javax.xml.namespace.QName dimName)
           
 void setDimension(javax.xml.namespace.QName dimName, XMLFragment dimension, int dimensionContainer)
          Sets a value for the indicated dimension in the indicated dimension container.
 void setXBRLContext(XBRLContext context)
          Stores the information form an XBRL context inside the internal structure
 void setXBRLScenario(XBRLScenario scenario)
           
 void setXBRLSegment(XBRLSegment segment)
           
 void unsetXBRLScenario(XBRLScenario scenario)
           
 void unsetXBRLSegment(XBRLSegment segment)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FContext

public FContext(XMLElementDefinition el)

FContext

public FContext(XMLElementDefinition el,
                XBRLContext ctx)
Method Detail

setXBRLContext

public void setXBRLContext(XBRLContext context)
Stores the information form an XBRL context inside the internal structure

Parameters:
context -

setXBRLSegment

public void setXBRLSegment(XBRLSegment segment)

setXBRLScenario

public void setXBRLScenario(XBRLScenario scenario)

add

public void add(XMLFragment fr,
                int container,
                boolean bIsOcc)
         throws XFxbrlfeBadSubsequentOCCValue
Parameters:
fr -
container - use -1 in the case of dimensions to NOT CHANGE original container. use XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario
bIsOcc -
Throws:
XFxbrlfeBadSubsequentOCCValue

unsetXBRLSegment

public void unsetXBRLSegment(XBRLSegment segment)

unsetXBRLScenario

public void unsetXBRLScenario(XBRLScenario scenario)

remove

public void remove(XMLFragment fr,
                   int container,
                   boolean bIsOcc)
            throws XFxbrlfeBadSubsequentOCCValue
Throws:
XFxbrlfeBadSubsequentOCCValue

getXBRLContext

public XBRLDimensionsContainer getXBRLContext(int container)
Converts the internal structures back to an XBRLContext object.

Note during the construction of this function, the time and entity is not stored so this class will not be able to generate a complete context. It can only generate the scenario container or the segment container as indicated in the parameters passed in.

Parameters:
container - use XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario
Returns:

clear

public void clear()
Clears all dimensional and non dimensional information on this context. All containers are clear.


removeDim

public void removeDim(javax.xml.namespace.QName dimName)
Parameters:
dimName -

getDimensions

public java.util.Collection<javax.xml.namespace.QName> getDimensions()
Returns a collection of QNames for of all XDT dimensions explicitly written in the context, either in the segment or the scenario containers.

Returns:
Collection of QNames

getDimension

public XMLFragment getDimension(javax.xml.namespace.QName dimName)
Returns the dimension value associated to the dimension passed in in the dimName parameter.

The returned data is the XMLFragment including the explicit or implicit member container.

If the dimension has a default, the default is not reported in the context. This method only cares about explicitly written values in the context so the returned value will always be null when a dimension for which a default has been reported is passed in. Note that if, according with other interpretations of closed hypercubes, the dimension for which a default does not apply for the primary item, this method will also return when that dimension is used.

Parameters:
dimName -
Returns:

getDimensionContainer

public int getDimensionContainer(javax.xml.namespace.QName dimName)
Parameters:
dimName -
Returns:
integer constant XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario

setDimension

public void setDimension(javax.xml.namespace.QName dimName,
                         XMLFragment dimension,
                         int dimensionContainer)
Sets a value for the indicated dimension in the indicated dimension container.

in order to get the preferred dimension container for a dimension call the getDimensionContainer(QName) method.

the dimension value must contain all elements including the xbrli:explicitMember or xbrli:typedMember element and all required attributes.

Parameters:
dimName -
dimension -
dimensionContainer - XDTHypercubeUse.SEGMENT for segment and XDTHypercubeUse.SCENARIO for scenario
See Also:
getDimensionContainer(QName)

getNonDimensionalInformation

public java.util.Collection<XMLFragment> getNonDimensionalInformation(int container)
Returns a collection of fragments with non dimensional information in the context container indicated in the parameter. Or null if the context container is invalid.

Parameters:
container - either XDTHypercubeUse.SCENARIO or XDTHypercubeUse.SEGMENT
Returns:
a Collection<XMLFragment> instance

isExplicitDimensionContainer

public static boolean isExplicitDimensionContainer(XMLFragment fragment)
returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions

Parameters:
frDimValue -
Returns:
boolean

isTypedDimensionContainer

public static boolean isTypedDimensionContainer(XMLFragment fragment)
returns true if the XMLFragment passed in as a parameter is a container for explicit dimensions

Parameters:
frDimValue -
Returns:
boolean


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa