com.ihr.xbrl.om.instance
Class XBRLFactNumeric

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.om.instance.XBRLFact
          extended by com.ihr.xbrl.om.instance.XBRLFactItem
              extended by com.ihr.xbrl.om.instance.XBRLFactNumeric
All Implemented Interfaces:
XBRLRelationshipPoint, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext

public class XBRLFactNumeric
extends XBRLFactItem

Author:
Ignacio

Field Summary
static javax.xml.namespace.QName decimals
           
static javax.xml.namespace.QName denominator
           
static javax.xml.namespace.QName numerator
           
static javax.xml.namespace.QName precision
           
static javax.xml.namespace.QName unitRef
           
 
Fields inherited from class com.ihr.xbrl.om.instance.XBRLFactItem
contextRef
 
Fields inherited from class com.ihr.xbrl.om.instance.XBRLFact
nil
 
Fields inherited from class com.ihr.xbrl.om.XMLFragment
CONCEPT_LABEL, CONCEPT_QNAME, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, idQName, NO_POSITION, OrderComparator, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER
 
Constructor Summary
XBRLFactNumeric(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit)
          Creates a numeric fact item providing all required information and NIL value
XBRLFactNumeric(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, XBRLNumber value)
          Creates a numeric fact item providing all required information
XBRLFactNumeric(XBRLFactsList container, net.sf.saxon.s9api.XdmNode root, XBRLItem item)
           
 
Method Summary
 void clear()
          Eliminates all this fact content
 XBRLFactNumeric clone()
           
 XBRLFactNumeric clone(DTSContainer newDTS)
          Clone current fact but in a new DTSContainer
 boolean equals(java.lang.Object obj)
          Sets a new XPathFunctionResolver for this object
 org.jdom.Element generateNode(boolean relativize, java.net.URI base)
          Generates the XBRLFactItem jdom node.
 java.util.Iterator<XBRLAttribute> getAttributes()
          Removes the unitRef,decimals and precision attributes from the XBRLFactNumeric Parent iterators already removes the id attribute and the contextRef attributes.
 int getFormat()
          Returns the representation format of this element XBRLNumericValue.DECIMALS or XBRLNumericValue.PRECISION
 java.lang.String getFriendlyName()
          Returns a string description that represents the element content in a form that users can understand.
 java.lang.String getFriendlyName(int modifiers, LabelsProvider lp)
          Returns a string description that represents the element content in a form that users can understand.
 XBRLNumber getNumericValue()
          Return the double representation of the value after dealing with @precision and @decimals This class returns either a XBRLNumericValue or an XBRLFractionValue depending on the surrounding value is a fraction or a number
 XBRLUnit getUnit()
          Obtains the unit of this fact
 net.sf.saxon.s9api.XdmValue getValue()
          Returns the value of this node.
 int hashCode()
           
 boolean isDuplicate(XBRLFact otherFact)
          Check if two items are duplicates as defined in the XBRL 2.1 specification
 boolean isDuplicate(XBRLFactItem otherFact, boolean reversePEqual)
          For internal purposes only during the calculation of isDuplicate of tuple children elements.
 boolean isFraction()
           
 void setFormat(int format)
          Sets the representation of this number to DECIMALS or PRECISION
 void setUnit(XBRLUnit unit)
          Sets a new unit for this fact
 void setValue(net.sf.saxon.value.AtomicValue value)
           
 XBRLNumber setValue(XBRLNumber newVal)
          Sets the value of this numeric fact to a new value.
 void setValue(net.sf.saxon.s9api.XdmValue value)
          Sets the value of this node
 boolean uEqual(XBRLFactItem factTotal)
          Evaluates it the two instantiation of the items are u-equal
 XBRLValidationReport validate(XBRLCoreProcessor proc)
          Validates the item or tuple
 boolean vEqual(XBRLFactItem toFact)
          Check if two items are value equal as defined in the XBRL 2.1 specification
 
Methods inherited from class com.ihr.xbrl.om.instance.XBRLFactItem
cEqual, createItemInstance, createItemInstance, createItemInstance, getContext, getDocumentURI, getElementDefinition, getStringValue, isBlank, isDescendantOrSibling, s_equal2, setBlank, setContext
 
Methods inherited from class com.ihr.xbrl.om.instance.XBRLFact
createItemOrTupleInstance, createItemOrTupleInstance, generateLocatorToNode, getElements, getInstance, getParent, getTaxonomy, getXPathToRoot, invalidate, isNil, pEqual, setId, setNil, setParent
 
Methods inherited from class com.ihr.xbrl.om.XMLFragment
addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAttribute, getAttributeQNameValue, getAttributes, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getDeclaredNamespaces, getDocument, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getToRelationships, getToRelationships, getToRelationships, getXPathNamespaceContext, getXPathToNode, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isNamespaceDefined, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setVariablesDefined, toString, valueEquals, xEqual
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

unitRef

public static final javax.xml.namespace.QName unitRef

decimals

public static final javax.xml.namespace.QName decimals

precision

public static final javax.xml.namespace.QName precision

numerator

public static final javax.xml.namespace.QName numerator

denominator

public static final javax.xml.namespace.QName denominator
Constructor Detail

XBRLFactNumeric

public XBRLFactNumeric(XBRLFactsList container,
                       XBRLContext context,
                       XBRLItem item,
                       XBRLUnit unit,
                       XBRLNumber value)
Creates a numeric fact item providing all required information

Parameters:
container -
context -
item -
unit -
value -
Throws:
XBRLRuntimeException - encapsulating an XBRLValidationException if the item type is not numeric

XBRLFactNumeric

public XBRLFactNumeric(XBRLFactsList container,
                       XBRLContext context,
                       XBRLItem item,
                       XBRLUnit unit)
Creates a numeric fact item providing all required information and NIL value

Parameters:
container -
context -
item -
unit -
Throws:
XBRLRuntimeException - encapsulating an XBRLValidationException if the item type is not numeric

XBRLFactNumeric

public XBRLFactNumeric(XBRLFactsList container,
                       net.sf.saxon.s9api.XdmNode root,
                       XBRLItem item)
                throws XBRLValidationException
Parameters:
container -
root -
item -
Throws:
XBRLValidationException - if the item is not numeric
Method Detail

clone

public XBRLFactNumeric clone()
Overrides:
clone in class XBRLFactItem

clone

public XBRLFactNumeric clone(DTSContainer newDTS)
Description copied from class: XBRLFact
Clone current fact but in a new DTSContainer

Overrides:
clone in class XBRLFactItem
Returns:
cloned XBRLFact

clear

public void clear()
           throws java.lang.Throwable
Eliminates all this fact content

Overrides:
clear in class XBRLFactItem
Throws:
java.lang.Throwable

setUnit

public void setUnit(XBRLUnit unit)
Sets a new unit for this fact

Parameters:
unit -

getUnit

public XBRLUnit getUnit()
Obtains the unit of this fact

Returns:
XBRLUnit
Throws:
XBRLValidationException

getAttributes

public java.util.Iterator<XBRLAttribute> getAttributes()
Removes the unitRef,decimals and precision attributes from the XBRLFactNumeric

Parent iterators already removes the id attribute and the contextRef attributes.

Overrides:
getAttributes in class XBRLFactItem
Returns:
Iterator<XBRLAttribute>
Since:
2.6.4
See Also:
XMLFragment.getAttributes()

setValue

public XBRLNumber setValue(XBRLNumber newVal)
Sets the value of this numeric fact to a new value.

Parameters:
newVal -
Returns:
XBRLNumericValue the old value or null

setValue

public void setValue(net.sf.saxon.value.AtomicValue value)
Overrides:
setValue in class XBRLFactItem

setValue

public void setValue(net.sf.saxon.s9api.XdmValue value)
Description copied from class: XMLFragment
Sets the value of this node

Overrides:
setValue in class XBRLFactItem

getValue

public net.sf.saxon.s9api.XdmValue getValue()
Description copied from class: XMLFragment
Returns the value of this node. If the value has been set to a jdom node then this function returns null If getDocument() is null then this function returns an empty sequence If getDocument() is not null this function tries to return an atomic value this function should be overridden by objects in this API

Overrides:
getValue in class XMLFragment
Returns:
a net.sf.saxon.s9api.XdmValue

getNumericValue

public XBRLNumber getNumericValue()
Return the double representation of the value after dealing with @precision and @decimals

This class returns either a XBRLNumericValue or an XBRLFractionValue depending on the surrounding value is a fraction or a number

Returns:
XBRLNumericValue or XBRLFractionValue
Throws:
XBRLRuntimeException - encapsulating an XBRLValidationException

uEqual

public boolean uEqual(XBRLFactItem factTotal)
Evaluates it the two instantiation of the items are u-equal

Specified by:
uEqual in class XBRLFactItem
Parameters:
factTotal -
Returns:
boolean
Throws:
XBRLValidationException

vEqual

public boolean vEqual(XBRLFactItem toFact)
Description copied from class: XBRLFactItem
Check if two items are value equal as defined in the XBRL 2.1 specification

Specified by:
vEqual in class XBRLFactItem
Parameters:
toFact - the other XBRLFactItem
Returns:
boolean

isDuplicate

public boolean isDuplicate(XBRLFact otherFact)
Description copied from class: XBRLFact
Check if two items are duplicates as defined in the XBRL 2.1 specification

Specified by:
isDuplicate in class XBRLFact
Parameters:
otherFact - the other XBRLFactItem
Returns:
boolean

isDuplicate

public boolean isDuplicate(XBRLFactItem otherFact,
                           boolean reversePEqual)
Description copied from class: XBRLFactItem
For internal purposes only during the calculation of isDuplicate of tuple children elements.

Specified by:
isDuplicate in class XBRLFactItem
Returns:
boolean value

validate

public XBRLValidationReport validate(XBRLCoreProcessor proc)
Description copied from class: XBRLFact
Validates the item or tuple

Overrides:
validate in class XBRLFactItem

generateNode

public org.jdom.Element generateNode(boolean relativize,
                                     java.net.URI base)
                              throws XBRLSerializationException
Description copied from class: XBRLFactItem
Generates the XBRLFactItem jdom node. If neccesary, generates the footnotes defined for this node.

Overrides:
generateNode in class XBRLFactItem
Parameters:
relativize - boolean indicating if URIs should be relativized to the base URI (see next argument)
base - the URI to which some attributes of this object should be relativided
Returns:
a clone of the surrounding jdom Element so it can be incorporated into multiple trees
Throws:
XBRLSerializationException

isFraction

public boolean isFraction()

getFormat

public int getFormat()
Returns the representation format of this element XBRLNumericValue.DECIMALS or XBRLNumericValue.PRECISION

Returns:
int

setFormat

public void setFormat(int format)
Sets the representation of this number to DECIMALS or PRECISION

Parameters:
format -

getFriendlyName

public java.lang.String getFriendlyName()
Description copied from class: XMLFragment
Returns a string description that represents the element content in a form that users can understand. This method may be overridden by parent classes.

Remarks, this method may return very long names not suitable for user interface

Overrides:
getFriendlyName in class XBRLFact
Returns:
Non empty String. Internationalization is enabled

getFriendlyName

public java.lang.String getFriendlyName(int modifiers,
                                        LabelsProvider lp)
Description copied from class: XMLFragment
Returns a string description that represents the element content in a form that users can understand. This method may be override by parent classes.

This function accepts flags that are defined as constants in XMLFragment in order to modify the output.

Overrides:
getFriendlyName in class XBRLFact
Parameters:
modifiers - integer
Returns:
a String representation of this fact.

hashCode

public int hashCode()
Overrides:
hashCode in class XBRLFactItem

equals

public boolean equals(java.lang.Object obj)
Description copied from class: XMLFragment
Sets a new XPathFunctionResolver for this object

Overrides:
equals in class XBRLFactItem


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