public class XBRLFactNumeric extends XBRLFactItem
XMLFragment.NodeNameIterator<T extends XMLFragment>, XMLFragment.NodeTypeIterator<T extends XMLFragment>
XBRLValidation.Direction
Modifier and Type | Field and Description |
---|---|
static javax.xml.namespace.QName |
decimals
The Constant decimals.
|
static javax.xml.namespace.QName |
denominator
The Constant denominator.
|
static javax.xml.namespace.QName |
numerator
The Constant numerator.
|
static javax.xml.namespace.QName |
precision
The Constant precision.
|
static javax.xml.namespace.QName |
unitRef
The Constant unitRef.
|
contextRef
ADD_NAMESPACE_INHERIT, baseQName, CONCEPT_LABEL, CONCEPT_QNAME, EASY_TO_READ, ELEMENT_LABEL, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, FACT_VALUE, HIDE_COMMON_ACCURACY, idQName, langQName, nil, NO_POSITION, OrderComparator, OrderComparator2, OrderComparatorReverse, PERIOD_BOP, PERIOD_TYPE, PERIOD_VALUE, RELATIONSHIP_TYPE, RESOURCE_TYPE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER
Constructor and Description |
---|
XBRLFactNumeric(DTSContainer dts)
This is the constructor used while parsing the incoming XBRL instance through the SAX parser.
|
XBRLFactNumeric(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
boolean addToParentNow)
Deprecated.
|
XBRLFactNumeric(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
java.lang.Number value,
int precisionOrDecimals,
XBRLNumber.ExactitudeMode format,
java.lang.String strValue,
boolean addToParentNow)
Creates a numeric fact for a numeric item providing all required information.
|
XBRLFactNumeric(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
java.lang.Number numerator,
java.lang.Number denominator,
boolean addToParentNow)
Creates a numeric fact for a fraction item providing all required information.
|
XBRLFactNumeric(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
XBRLNumber value,
boolean addToParentNow)
Deprecated.
|
XBRLFactNumeric(XBRLFactsList container,
XMLFragment node,
XBRLItem item)
Instantiates a new XBRL fact numeric.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkPrecision0()
Check precision 0.
|
void |
clear()
Eliminates all this fact content.
|
XBRLFactNumeric |
clone()
Clone.
|
XBRLFactNumeric |
clone(DTSContainer newDTS)
Clone.
|
boolean |
equals(java.lang.Object obj)
Equals.
|
XBRLFactNumeric |
generateNode()
Generate 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.
|
java.math.BigDecimal |
getBigDecimal()
Access to the value as a BigDecimal, this method only works if the
XBRLFactNumeric is Number and not is Fraction.
|
java.lang.String |
getDecimals()
Gets the decimals.
|
int |
getDecimalsRealOrInferred()
Gets the decimals real or inferred.
|
java.lang.Number |
getDenominator()
Gets the denominator.
|
static int |
getExponent(java.lang.String strValue)
Gets the exponent.
|
net.sf.saxon.tree.linked.NodeImpl |
getFirstChild() |
XBRLNumber.ExactitudeMode |
getFormat()
Returns the representation format of this element
XBRLNumber.DECIMALS or XBRLNumber.PRECISION
|
double |
getFractionValue()
Gets the fraction value.
|
java.lang.String |
getFriendlyName()
Gets the friendly name.
|
java.lang.String |
getFriendlyName(int modifiers,
LabelsProvider lp)
Gets the friendly name.
|
net.sf.saxon.tree.linked.NodeImpl |
getLastChild() |
double |
getNonFractionValue(boolean bRoundNumeric)
Gets the double value from a non fraction fact to export.
|
int |
getNumberOfChildren() |
java.lang.Number |
getNumerator()
Gets the numerator.
|
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.
|
static net.sf.saxon.value.NumericValue |
getNumericValue(XBRLXSDTypeDefinition type,
java.lang.Object value)
Returns a NumericValue representation of the value according to the type definition in the parameter.
|
java.lang.String |
getNumericValueAsString()
Return the String representation of the value.
|
java.lang.String |
getPrecision()
Gets the precision.
|
int |
getPrecisionRealOrInferred()
Gets the precision real or inferred.
|
XBRLUnit |
getUnit()
Obtains the unit of this fact.
|
net.sf.saxon.s9api.XdmValue |
getValue()
Gets the value.
|
boolean |
hasChildNodes() |
int |
hashCode()
Hash code.
|
static int |
inferredDecimals(int precision,
java.lang.String strValue)
Inferred decimals.
|
static int |
inferredDecimalsBug368(int precision,
java.lang.String rawStrValue)
Inferred decimals bug368.
|
static int |
inferredPrecision(java.lang.String decimalsStr,
java.lang.String strValue)
Inferred precision.
|
boolean |
isDecimals()
Checks if is decimals.
|
boolean |
isDuplicate(XBRLFact otherFact)
Checks if is duplicate.
|
boolean |
isDuplicate(XBRLFactItem otherFact,
boolean reversePEqual)
Checks if is duplicate.
|
boolean |
isFraction()
Checks if is fraction.
|
boolean |
isHashDependsOnAtribute(javax.xml.namespace.QName attributeName)
Checks if is hash depends on atribute.
|
boolean |
isNumber()
Checks if is a number (and not a fraction).
|
boolean |
isPercent()
Checks if a number is derived from xbrliPercentItemType.
|
boolean |
isPrecision()
Checks if is precision.
|
boolean |
isPure()
check when this numeric fact is based on pureItemType or derived from it .
|
static XBRLFactNumeric |
make(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
boolean addToParent)
Make.
|
static XBRLFactNumeric |
make(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
java.lang.Number value,
int precisionOrDecimals,
XBRLNumber.ExactitudeMode format,
java.lang.String strValue,
boolean addToParentNow)
Make.
|
static XBRLFactNumeric |
make(XBRLFactsList container,
XBRLContext context,
XBRLItem item,
XBRLUnit unit,
java.lang.Number numerator,
java.lang.Number denominator,
boolean addToParentNow)
Make.
|
static java.lang.String |
numericValueToString(java.lang.Number value)
Calculates a string representation of an object value.
|
static java.lang.String |
parseExactitudeValue(int fromIntvalue)
Transforms an INT value to string so the INF token is properly
converted to "INF" and other values as integers.
|
static int |
parseExactitudeValue(java.lang.String fromString)
Transforms an string representation of the exactitude value to
the int format.
|
void |
setDecimals(java.lang.String sDecimals)
At moment, used only on XBRLNumericValue.
|
boolean |
setFormat(XBRLNumber.ExactitudeMode format)
Sets the representation of this number to DECIMALS or PRECISION.
|
boolean |
setNil(boolean newValue)
Sets the nil.
|
void |
setPrecision(java.lang.String sPrecision)
At moment, used only on XBRLNumericValue.
|
void |
setUnit(XBRLUnit newUnit)
Sets a new unit for this fact.
|
void |
setValue(net.sf.saxon.value.AtomicValue value)
Sets the value.
|
XBRLNumber |
setValue(java.lang.Number value,
int precisionOrDecimals,
XBRLNumber.ExactitudeMode format,
java.lang.String strValue)
Sets the value of this numeric fact to a new value.
|
XBRLNumber |
setValue(java.lang.Number numerator,
java.lang.Number denominator)
Sets the value of this numeric fact to a new fraction value.
|
java.lang.Number |
setValue(java.lang.Number value,
java.lang.String strValue)
Sets the value of this numeric fact to a new value.
|
void |
setValue(java.lang.String value)
Sets the value.
|
XBRLNumber |
setValue(XBRLNumber value)
Sets the value of this numeric fact to a new value.
|
void |
setValue(net.sf.saxon.s9api.XdmValue value)
Sets the value.
|
boolean |
uEqual(XBRLFactItem factTotal)
Evaluates it the two instantiation of the items are u-equal.
|
boolean |
vEqual(XBRLFactItem toFact)
V equal.
|
cEqual, createFractionItemInstance, createItemInstance, createItemInstance, createNonNumericItemInstance, createNumericItemInstance, getContext, getDocumentURI, getElementDefinition, getStringValue, isDescendantOrSibling, s_equal2, setContext
addEvent, createFractionItemInstance, createItemOrTupleInstance, createNonNumericItemInstance, createNumericItemInstance, createTupleInstance, delete, getCode, getElements, getHistory, getHistoryAsHTMLString, getHistoryAsString, getInstance, getParentXBRL, getParentXBRLFactsList, getTaxonomy, getValidationReport, getXPathToRoot, invalidate, invalidate, isBlank, isOnValidation, pEqual, setBlank, setCode, setId, setInstance, setParent, setValue, setValue, setValue, setValue, validate
addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addChild, addChildArray, addChildAt, addChildNode, addChildNodeArray, addChildNodeAt, addChildNodeInBatch, addComment, addFromRelationship, addNamespace, addNamespace, addPropertyChangeListener, addToRelationship, changeBase, checkBase, childExists, commitBatch, copy, createComment, delAttribute, delAttribute, equalXdmValues, findFirstNodeOfClass, findPosition, firePropertyChangeEvent, generateId, generateLocatorToNode, generatePrefix, getAllAttributes, getAttribute, getAttributeAtomicValue, getAttributeBooleanValue, getAttributeGroundedValue, getAttributeQNameValue, getAttributeValue, getBase, getBase, getBooleanValue, getChildren, getChildStringValue, getConfiguration, getContainer, getContainerDocumentURI, getDocument, getElement, getElement, getFirstChildNoComment, getFragment, getFriendlyName, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getInScopeNamespaces, getLang, getLastChildNoComment, getNamePool, getNamespaceBinding, getNamespaceURI, getNextSiblingNoComment, getNodeName, getNthElement, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParentDocument, getPrefix, getPrefixes, getPropertyChangeListeners, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getXPath, getXPathFromXPointer, getXPathNamespaceContext, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerXPath2Scheme, initialise, internalToString, isAttribute, isChangeHashEnabled, isDead, isEmpty, isNamespaceDefined, isNil, moveNamespacesUp, objEquals, objHashCode, reindex, removeChild, removeChildNode, removeFromRelationship, removeNamespace, removePropertyChangeListener, removeToRelationship, replace, replaceChild, replaceStringValue, resetElements, resolveHRef, s_equal2_xp2, s_equal2_xp2, s_equal2, s_equal2, s_equal2, setAttributeList, setAttributes, setBase, setChildrenClone, setDirty, setElements, setLang, setModified, setNamespaceDeclarations, setNamespaces, setNodeName, setRawParentXBRL, setValue, toString, valueEquals, xEqual
addAttribute, addNamespace, generateId, getAttributeList, getAttributeValue, getAttributeValue, getBaseURI, getColumnNumber, getDeclaredNamespaces, getDocumentRoot, getLineNumber, getNameCode, getNamespaceList, getNodeKind, getRoot, getSchemaType, getSystemId, getTypeAnnotation, getURIForPrefix, gsetAttributeCollection, isId, isInScopeNamespace, isNilled, iteratePrefixes, removeAttribute, removeTypeAnnotation, rename, setLocation, setNameCode, setNamespaceList, setSystemId, setTypeAnnotation
atomize, compareOrder, comparePosition, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getSiblingPosition, getSuccessorElement, getURI, head, insertSiblings, isDeleted, isIdref, isSameNodeInfo, iterate, iterateAxis, iterateAxis, newBuilder, replace
public static final javax.xml.namespace.QName unitRef
public static final javax.xml.namespace.QName decimals
public static final javax.xml.namespace.QName precision
public static final javax.xml.namespace.QName numerator
public static final javax.xml.namespace.QName denominator
@Deprecated public XBRLFactNumeric(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, XBRLNumber value, boolean addToParentNow)
container
- the containercontext
- the contextitem
- the itemunit
- the unitvalue
- the valueaddToParentNow
- if this is true, the new fact will be added to the instance. If this is false, call container.add(...)
laterpublic XBRLFactNumeric(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, java.lang.Number numerator, java.lang.Number denominator, boolean addToParentNow)
container
- the parent container for the new fact, can be nullcontext
- the contextitem
- the itemunit
- the unitnumerator
- partdenominator
- partaddToParentNow
- if this is true, the new fact will be added to the instance. If this is false, call container.add(...)
laterpublic XBRLFactNumeric(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, java.lang.Number value, int precisionOrDecimals, XBRLNumber.ExactitudeMode format, java.lang.String strValue, boolean addToParentNow)
container
- the parent container for the new fact, can be nullcontext
- the contextitem
- the itemunit
- the unitvalue
- the valueprecisionOrDecimals
- the precision or decimalsformat
- the formatstrValue
- maybe nulladdToParentNow
- if this is true, the new fact will be added to the instance. If this is false, call container.add(...)
later@Deprecated public XBRLFactNumeric(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, boolean addToParentNow)
container
- the containercontext
- the contextitem
- the itemunit
- the unitaddToParentNow
- if this is true, the new fact will be added to the instance. If this is false, call container.add(...)
laterpublic XBRLFactNumeric(XBRLFactsList container, XMLFragment node, XBRLItem item) throws XBRLValidationException
container
- the facts container this fact will be added to. It might be an instance or a tuple or might be nullnode
- the XMLFragment this node will replace in the container instanceitem
- the XBRL numeric fact itemXBRLValidationException
- if the item is not numericpublic XBRLFactNumeric(DTSContainer dts)
dts
- the dtspublic static XBRLFactNumeric make(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, boolean addToParent)
#make(XBRLFactsList, XBRLContext, XBRLItem, XBRLUnit, Number, int, ExactitudeMode, String)
container
- the containercontext
- the contextitem
- the itemunit
- the unitaddToParent
- the add to parentpublic static XBRLFactNumeric make(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, java.lang.Number value, int precisionOrDecimals, XBRLNumber.ExactitudeMode format, java.lang.String strValue, boolean addToParentNow)
container
- the containercontext
- the contextitem
- the itemunit
- the unitvalue
- the valueprecisionOrDecimals
- the precision or decimalsformat
- the formatstrValue
- the str valueaddToParentNow
- if this is true, the new fact will be added to the instance. If this is false, call container.add(...)
laterpublic static XBRLFactNumeric make(XBRLFactsList container, XBRLContext context, XBRLItem item, XBRLUnit unit, java.lang.Number numerator, java.lang.Number denominator, boolean addToParentNow)
container
- the containercontext
- the contextitem
- the itemunit
- the unitnumerator
- the numeratordenominator
- the denominatoraddToParentNow
- if this is true, the new fact will be added to the instance. If this is false, call container.add(...)
laterpublic XBRLFactNumeric clone()
clone
in class XBRLFactItem
public XBRLFactNumeric clone(DTSContainer newDTS)
clone
in class XBRLFactItem
newDTS
- the new DTSpublic void clear() throws java.lang.Throwable
public void setUnit(XBRLUnit newUnit)
newUnit
- the new unitpublic XBRLUnit getUnit()
XBRLRuntimeException
- in case of XBRLValidationException
produced during the getUnitById call on the instancepublic java.util.Iterator<XBRLAttribute> getAttributes()
Parent iterators already removes the id attribute and the contextRef attributes.
getAttributes
in class XBRLFactItem
XMLFragment.getAttributes()
public boolean isHashDependsOnAtribute(javax.xml.namespace.QName attributeName)
isHashDependsOnAtribute
in class XBRLFactItem
attributeName
- the attribute namepublic XBRLNumber setValue(XBRLNumber value)
value
- the new valpublic XBRLNumber setValue(java.lang.Number value, int precisionOrDecimals, XBRLNumber.ExactitudeMode format, java.lang.String strValue)
value
- the new Number value, can be nullprecisionOrDecimals
- the precision or decimalsformat
- the ExactitudeMode formatstrValue
- the string value, maybe nullpublic java.lang.Number setValue(java.lang.Number value, java.lang.String strValue)
value
- the new Number valuestrValue
- the string value, maybe nullpublic XBRLNumber setValue(java.lang.Number numerator, java.lang.Number denominator)
numerator
- partdenominator
- partpublic boolean setNil(boolean newValue)
public void setValue(net.sf.saxon.s9api.XdmValue value)
public void setValue(net.sf.saxon.value.AtomicValue value)
public void setValue(java.lang.String value)
public net.sf.saxon.s9api.XdmValue getValue()
public double getNonFractionValue(boolean bRoundNumeric)
bRoundNumeric
- true to round the numerical values according to their accuracypublic XBRLNumber getNumericValue()
This class returns either a XBRLNumericValue or an XBRLFractionValue depending on the surrounding value is a fraction or a number.
public java.lang.String getNumericValueAsString()
public boolean uEqual(XBRLFactItem factTotal)
uEqual
in class XBRLFactItem
factTotal
- the fact totalpublic boolean vEqual(XBRLFactItem toFact)
vEqual
in class XBRLFactItem
toFact
- the to factpublic boolean isDuplicate(XBRLFact otherFact)
isDuplicate
in class XBRLFact
otherFact
- the other factpublic boolean isDuplicate(XBRLFactItem otherFact, boolean reversePEqual)
isDuplicate
in class XBRLFactItem
otherFact
- the other factreversePEqual
- the reverse P equalpublic XBRLFactNumeric generateNode() throws XBRLSerializationException
generateNode
in class XBRLFactItem
XBRLSerializationException
- the XBRL serialization exceptionpublic boolean isFraction()
public boolean isNumber()
public boolean isPercent()
public java.math.BigDecimal getBigDecimal()
isFraction()
,
isNumber()
public double getFractionValue()
public XBRLNumber.ExactitudeMode getFormat()
public boolean setFormat(XBRLNumber.ExactitudeMode format)
format
- the new formatpublic java.lang.String getFriendlyName()
getFriendlyName
in class XBRLFact
public java.lang.String getFriendlyName(int modifiers, LabelsProvider lp)
getFriendlyName
in class XBRLFact
modifiers
- the modifierslp
- the lppublic int hashCode()
hashCode
in interface net.sf.saxon.om.NodeInfo
hashCode
in class XBRLFactItem
public boolean equals(java.lang.Object obj)
equals
in interface net.sf.saxon.om.NodeInfo
equals
in class XBRLFactItem
obj
- the objpublic void setPrecision(java.lang.String sPrecision)
sPrecision
- the new precisionpublic void setDecimals(java.lang.String sDecimals)
sDecimals
- the new decimalspublic java.lang.String getDecimals()
decimals
attribute.
If the numeric fact is reported on precision, this method returns
nullisDecimals()
,
parseExactitudeValue(String)
,
XBRLNumber.getDecimalsRealOrInferred()
public java.lang.String getPrecision()
precision
attribute.
If the numeric fact is reported on decimals, this method returns
nullisPrecision()
,
parseExactitudeValue(String)
,
XBRLNumber.getPrecisionRealOrInferred()
public boolean isDecimals()
decimals
attributepublic boolean isPrecision()
precision
attributepublic static net.sf.saxon.value.NumericValue getNumericValue(XBRLXSDTypeDefinition type, java.lang.Object value)
type
- XBRLXSDTypeDefinitionvalue
- the valuepublic static int inferredDecimalsBug368(int precision, java.lang.String rawStrValue)
precision
- the precisionrawStrValue
- the raw str valuepublic static int inferredPrecision(java.lang.String decimalsStr, java.lang.String strValue)
decimalsStr
- the decimals strstrValue
- the str valuepublic static int parseExactitudeValue(java.lang.String fromString)
fromString
- the from stringpublic static java.lang.String parseExactitudeValue(int fromIntvalue)
fromIntvalue
- the from intvaluepublic java.lang.Number getNumerator()
public java.lang.Number getDenominator()
public boolean checkPrecision0()
public int getPrecisionRealOrInferred()
public int getDecimalsRealOrInferred()
public static java.lang.String numericValueToString(java.lang.Number value)
DecimalFormat("################################.00000000000000000000000000000000",new DecimalFormatSymbols(Locale.US))
NaN is an accepted input value; in this case, the returned string is NaN.value
- a Numberpublic static int inferredDecimals(int precision, java.lang.String strValue)
precision
- the precisionstrValue
- the str valuepublic static int getExponent(java.lang.String strValue)
strValue
- capitalized so the exponent will be the number after Epublic boolean isPure()
public final boolean hasChildNodes()
hasChildNodes
in interface net.sf.saxon.om.NodeInfo
hasChildNodes
in class net.sf.saxon.tree.linked.NodeImpl
public final int getNumberOfChildren()
public final net.sf.saxon.tree.linked.NodeImpl getFirstChild()
getFirstChild
in interface net.sf.saxon.tree.util.SteppingNode<net.sf.saxon.tree.linked.NodeImpl>
getFirstChild
in class net.sf.saxon.tree.linked.NodeImpl
public final net.sf.saxon.tree.linked.NodeImpl getLastChild()
getLastChild
in class net.sf.saxon.tree.linked.NodeImpl
Copyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa