|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ihr.xbrl.om.instance.XBRLNumericValue
public class XBRLNumericValue
A XBRLNumericValue object is the representation of a number inside a numeric fact item. This means that it contains a Number object which is the value, and the value of the number precision. This class provides methods to operate with XBRL Numbers and compare them.
Starting on 8/4/2009. In order to implement the functionality that this object can be created without a value and the value can be set later, this object now has a flag indicating whether the numeric value is set of is blank.
| Field Summary |
|---|
| Fields inherited from interface com.ihr.xbrl.om.instance.XBRLNumber |
|---|
DECIMALS, INF, PRECISION |
| Constructor Summary | |
|---|---|
XBRLNumericValue(XBRLFactNumeric fact)
Creation of an empty XBRLNumericValue (Blank) This is useful for editing purposes. |
|
XBRLNumericValue(XBRLFactNumeric fact,
java.lang.Number value,
int precisionOrDecimals)
Creation from Java Number object |
|
XBRLNumericValue(XBRLFactNumeric fact,
net.sf.saxon.value.NumericValue value,
int precisionOrDecimals)
Creation from a Saxon NumericValue object |
|
| Method Summary | |
|---|---|
XBRLNumericValue |
clone()
|
boolean |
eq(XBRLNumber value2)
|
boolean |
equals(java.lang.Object other)
|
java.math.BigDecimal |
getBigDecimal()
returns the internal representation of this value as a BigDecimal |
java.lang.String |
getDecimals()
Convert precision value into decimals value if needed and returns the decimals value It is returned as a string because "INF" is a valid value. |
static int |
getExponent(java.lang.String strValue)
|
XBRLFactNumeric |
getFact()
Access to the XBRLFactNumeric that is the container of this XBRLNumericValue. |
int |
getInferredPrecision()
Gets the inferred precision for this numeric value |
java.lang.String |
getPrecision()
The value of the precision for this numeric value. |
java.lang.Number |
getValue()
Access to the surrounding number value this object is encapsulating. |
static net.sf.saxon.value.NumericValue |
getValue(XBRLXSDTypeDefinition type,
java.lang.Object value)
Returns a NumericValue representation of the value according to the type definition in the parameter |
int |
hashCode()
|
static int |
inferredDecimals(int precision,
java.lang.String strValue)
|
static int |
inferredDecimalsBug368(int precision,
java.lang.String rawStrValue)
|
static int |
inferredPrecision(java.lang.String decimalsStr,
java.lang.String strValue)
|
boolean |
isBlank()
true if this XBRLNumericValue has no value assigned |
XBRLNumericValue |
multiply(double weight)
|
boolean |
ne(XBRLNumber value2)
|
static java.lang.String |
numericValueToString(java.lang.Number value)
Calculates a string representation of an object value. |
XBRLNumericValue |
plus(XBRLNumber value2)
|
XBRLNumericValue |
roundTo(int precision2)
|
void |
setDecimals(int decimals)
|
void |
setFact(XBRLFactNumeric factNumeric)
|
void |
setPrecision(int precision)
|
void |
setValue(java.lang.Number value)
|
java.lang.String |
toString()
Returns a human readable representation of this number. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XBRLNumericValue(XBRLFactNumeric fact)
fact - the parent fact, may be null
public XBRLNumericValue(XBRLFactNumeric fact,
java.lang.Number value,
int precisionOrDecimals)
fact - the XBRLFactNumeric instance for which this is the XBRLNumericValuevalue - Java Number or derived from Number object instanceprecisionOrDecimals - integer, depending on the bug368 the value goes to the precision or decimals property
public XBRLNumericValue(XBRLFactNumeric fact,
net.sf.saxon.value.NumericValue value,
int precisionOrDecimals)
fact - the XBRLFactNumeric instance for which this is the XBRLNumericValuevalue - NumericValue form saxonica libraryprecisionOrDecimals - integer| Method Detail |
|---|
public XBRLFactNumeric getFact()
XBRLNumberIt may be null
getFact in interface XBRLNumberpublic boolean isBlank()
XBRLNumber
isBlank in interface XBRLNumberpublic java.lang.String toString()
The representation uses the decimal format #,##0.####;(#,##0.####) that is defined as a constant
inside this class followed by p(n) which means precision n, n is the number precision (explicit or inferred) according to the
XBRL 2.1 standard. This includes the constant INF that represents INFINITE precision.
Examples: -1,000,000 p(4) -1,000,000 p(INF)
toString in class java.lang.Objectpublic java.lang.Number getValue()
Return null if the value is nil and the fact is assigned and isNil() returns true otherwise this returns the value, that also may be null.
public void setValue(java.lang.Number value)
value - a Number to be set as the valuepublic XBRLNumericValue clone()
clone in interface XBRLNumberclone in class java.lang.Objectpublic java.lang.String getPrecision()
public XBRLNumericValue multiply(double weight)
multiply in interface XBRLNumberpublic XBRLNumericValue plus(XBRLNumber value2)
plus in interface XBRLNumberpublic boolean ne(XBRLNumber value2)
ne in interface XBRLNumberpublic int getInferredPrecision()
XBRLNumber
getInferredPrecision in interface XBRLNumberpublic boolean eq(XBRLNumber value2)
eq in interface XBRLNumberpublic XBRLNumericValue roundTo(int precision2)
public boolean equals(java.lang.Object other)
equals in class java.lang.Object
public static net.sf.saxon.value.NumericValue getValue(XBRLXSDTypeDefinition type,
java.lang.Object value)
type - XBRLXSDTypeDefinition
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 Number
public java.lang.String getDecimals()
XBRLNumber
getDecimals in interface XBRLNumber
public static int inferredDecimals(int precision,
java.lang.String strValue)
precision - strValue -
public static int inferredDecimalsBug368(int precision,
java.lang.String rawStrValue)
precisionInt - rawStrValue -
public static int inferredPrecision(java.lang.String decimalsStr,
java.lang.String strValue)
decimalsStr -
public static int getExponent(java.lang.String strValue)
strValue - capitalized so the exponent will be the number after E
public void setPrecision(int precision)
public void setDecimals(int decimals)
public void setFact(XBRLFactNumeric factNumeric)
setFact in interface XBRLNumberpublic int hashCode()
hashCode in interface XBRLNumberhashCode in class java.lang.Objectpublic java.math.BigDecimal getBigDecimal()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||