com.batavia.xbrl.instance
Interface Item

All Superinterfaces:
java.lang.Comparable, ComparablePart, Fact, IdHolder, IdKeeper, InstanceElement, java.io.Serializable, org.relaxng.datatype.ValidationContext, XbrlElement, XmlElement, XmlParticle
All Known Subinterfaces:
DimensionalFractionItem, DimensionalItem, Fraction

public interface Item
extends Fact

an item represents a single fact or business measurement.

Copyright 2006 J2R BV, The Netherlands.

Part of Licensed Materials.

www.batavia-xbrl.com

Author:
Ron van Ardenne

Method Summary
 void calculatePrecisionToUse()
          Calculate the precision value for this item based on the actual value and keep it for later use.
 Context getContext()
          The context for this item is retreived based on the contextref value.
 XmlAttribute getContextRef()
          The context ref attribute value identifies the context for this item.
 XmlAttribute getDecimals()
          The Decimals attribute value for this item.
 java.lang.String getFormattedContent()
          Get the value for this item formatted.
 java.lang.String getFormattedContent(java.lang.Integer overrulingPrecision)
          format the eventual numeric items to a decimal representation
 double getFormattedValue()
          Get the value for this item formatted.
 int getInferredPrecision()
          Infer the precission based on the decimals attribute.
 XmlAttribute getNil()
          The nil attribute can have a textual bolean value true or false. true means the element has a value equal nil.
 XmlAttribute getPrecision()
          The Precision attribute value for this item.
 int getPrecisionToUse()
          Return the precision that should be used when perfoming calculations with the value of this item.
 Unit getUnit()
          The Unit for this item is retreived based on the unitref value.
 XmlAttribute getUnitRef()
          The Unit ref attribute value identifies the Unit for this item.
 boolean isDuplicateExceptParent(Fact otherFact)
          Tests if the item is a duplicate off the other fact except for the parent they are both contained by.
 boolean isNumeric()
          Determines if the concept for this item in the DTS has a numeric datatype.
 void overrulePrecisionToUse(int prec)
          Set the precission to use to the new prec value so the item can indicate the value is to be used with this new precission in mind.
 void resetUnit()
          Reset the object reference to the Unit object that is refered by the unitRef attribute on this Item fact.
 void setContextRef(XmlAttribute contextRef)
          The context ref attribute value identifies the context for this item.
 void setDecimals(XmlAttribute decimals)
          The Decimals attribute value for this item.
 void setNil(XmlAttribute nil)
           
 void setPrecision(XmlAttribute precision)
          The Precision attribute value for this item.
 void setUnitRef(XmlAttribute unitRef)
          The Unit ref attribute value identifies the Unit for this item.
 boolean validate(ValidationDocument msgs)
          Validate this xbrl part (of the instance and/or its supporting discoverable taxonomy set) and add messages on any problem to the given XbrlValidationMessages collection.
 boolean validateValue(ValidationDocument msgs)
          Validate the value of this item against the datatype that is defined by the concept of this item in the DTS
 
Methods inherited from interface com.batavia.xbrl.instance.Fact
createAttribute, createFootnote, createId, getConcept, getFactCompareIdentifier, getFootnotes, getId, getLabel, getType, getXbrlInstanceRoot, isDuplicate, isInferred, isRendered, requestExtraSibblings, setId, setInferred, setRendered, setXbrlInstanceRoot
 
Methods inherited from interface com.batavia.xbrl.instance.InstanceElement
createChildElement, getAllowedSubstitutions, getChildren, getMyDiscoverableTaxonomySet, getXbrlRoot
 
Methods inherited from interface com.batavia.xbrl.XbrlElement
addChild, fromXbrl, getXbrlElementNameSpace, removeChild, toXbrlStream, toXbrlString
 
Methods inherited from interface com.batavia.xml.XmlElement
addAttribute, addChild, addChildren, addComment, addMessage, addNameSpace, clearMessages, fromXml, getAttribute, getAttribute, getAttributeSet, getChild, getChildren, getChildren, getDefaultNameSpace, getDocumentHref, getErrorMessage, getFullyQualifiedNameValue, getMappedChildren, getMessages, getName, getNameSpace, getNameSpacePrefixes, getNameSpaces, getPointedElement, getValidXmlBase, getValue, getXmlElementNameSpace, getXmlRoot, isValid, moveChild, removeAttribute, removeChild, resolvePointedValue, resolvePointedXmlParticle, setAttributeValue, setChildren, setDocumentHref, setErrorMessage, setInit, setName, setTargetNameSpace, setValue, toXml, toXml, toXmlStream, toXmlString, toXstringBuffer
 
Methods inherited from interface com.batavia.xml.XmlParticle
destroy, getBaseUri, getParent, getPrefix, getTargetNameSpace, isBoolean, isNumber, p_equal, resolveNamespacePrefix, setParent, toXstring
 
Methods inherited from interface com.batavia.xml.ComparablePart
c_equal, identical, s_equal, u_equal, v_equal, x_equal
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.relaxng.datatype.ValidationContext
isNotation, isUnparsedEntity
 
Methods inherited from interface com.batavia.xml.IdKeeper
addIdHolder, getHolder, removeIdHolder
 

Method Detail

getNil

XmlAttribute getNil()
The nil attribute can have a textual bolean value true or false. true means the element has a value equal nil.

Returns:
XmlAttribute the nil attribute.

setNil

void setNil(XmlAttribute nil)
Parameters:
nil - The nil attribute to set.

getContextRef

XmlAttribute getContextRef()
The context ref attribute value identifies the context for this item.

Returns:
XmlAttribute context ref

getContext

Context getContext()
The context for this item is retreived based on the contextref value.

Returns:
Context that is identified by the context ref attribute.

getUnit

Unit getUnit()
The Unit for this item is retreived based on the unitref value.

Returns:
Unit that is identified by the unitref attribute.

setContextRef

void setContextRef(XmlAttribute contextRef)
The context ref attribute value identifies the context for this item.

Parameters:
XmlAttribute - context ref

getUnitRef

XmlAttribute getUnitRef()
The Unit ref attribute value identifies the Unit for this item.

Returns:
XmlAttribute Unit ref

setUnitRef

void setUnitRef(XmlAttribute unitRef)
The Unit ref attribute value identifies the Unit for this item.

Parameters:
XmlAttribute - Unit ref

getPrecision

XmlAttribute getPrecision()
The Precision attribute value for this item.

Returns:
XmlAttribute Precision

setPrecision

void setPrecision(XmlAttribute precision)
The Precision attribute value for this item.

Parameters:
XmlAttribute - Precision

getDecimals

XmlAttribute getDecimals()
The Decimals attribute value for this item.

Returns:
XmlAttribute Decimals

setDecimals

void setDecimals(XmlAttribute decimals)
The Decimals attribute value for this item.

Parameters:
XmlAttribute - Decimals

validate

boolean validate(ValidationDocument msgs)
Validate this xbrl part (of the instance and/or its supporting discoverable taxonomy set) and add messages on any problem to the given XbrlValidationMessages collection.

Specified by:
validate in interface XmlElement
Parameters:
msgs - The messages that indicate the problems with the instance and or its supporting taxonomy set
Returns:
true if there ar no problems with this XbrlElementImpl

validateValue

boolean validateValue(ValidationDocument msgs)
Validate the value of this item against the datatype that is defined by the concept of this item in the DTS

Returns:
true when the value is valid

calculatePrecisionToUse

void calculatePrecisionToUse()
Calculate the precision value for this item based on the actual value and keep it for later use. Only has effect when the precesion is not already inferred from a possible decimals attribute value. *


getPrecisionToUse

int getPrecisionToUse()
Return the precision that should be used when perfoming calculations with the value of this item. Either the precission, inferred precision form decimals or the actual precission of the value is returned.

Returns:
int the precission to use

getFormattedContent

java.lang.String getFormattedContent()
Get the value for this item formatted. When the conecpt is numeric the value is formatted with thousand and decimal separators and rounded according to the precision to use.

Returns:
String with formatted content

getFormattedValue

double getFormattedValue()
Get the value for this item formatted. When the conecpt is numeric the value is rounded according to the precision to use.

Returns:
String with formatted content

isNumeric

boolean isNumeric()
Determines if the concept for this item in the DTS has a numeric datatype.

Returns:
boolean true when the datatype for the concept for this item in the DTS is numeric.

getFormattedContent

java.lang.String getFormattedContent(java.lang.Integer overrulingPrecision)
format the eventual numeric items to a decimal representation

Returns:

getInferredPrecision

int getInferredPrecision()
Infer the precission based on the decimals attribute.

Returns:
int the inferred precision

isDuplicateExceptParent

boolean isDuplicateExceptParent(Fact otherFact)
Tests if the item is a duplicate off the other fact except for the parent they are both contained by.

Specified by:
isDuplicateExceptParent in interface Fact
Returns:
true if the fact is a duplicate

overrulePrecisionToUse

void overrulePrecisionToUse(int prec)
Set the precission to use to the new prec value so the item can indicate the value is to be used with this new precission in mind.

Parameters:
prec - that overrules the excisting precision to use.

resetUnit

void resetUnit()
Reset the object reference to the Unit object that is refered by the unitRef attribute on this Item fact.