com.ihr.xbrl.mapper
Class Fact

java.lang.Object
  extended by com.ihr.xbrl.mapper.Fact
All Implemented Interfaces:
HasFacts

public class Fact
extends java.lang.Object
implements HasFacts

Represents instructions to create a fact item or tuple

Author:
Ignacio

Nested Class Summary
static class Fact.Type
           
 
Field Summary
static int ALL
           
static int PREV
           
static int SINGLE
           
 
Constructor Summary
Fact(Fact.Type type, HasFacts parent, XBRLDataSource source, MapperContext context, java.lang.String mapIdentifier, XMLElementDefinition concept, XBRLUnit unit, int multi)
           
 
Method Summary
 void addFact(Fact newFact)
          Adds a new Fact to the end of the Facts container.
 void addFactAt(Fact newFact, int pos)
          Adds a new Fact at the position indicated by pos.
 void delFact(Fact fact)
          Removes a fact from the container
 boolean equals(java.lang.Object obj)
           
 java.util.Iterator<Fact> getChildrenFacts()
          Access to an iterator over the children facts of this object
 XMLElementDefinition getConcept()
          The concept definition in the taxonomy that corresponds to this fact in the template
 MapperContext getContext()
           
 java.util.Collection<XBRLFact> getFacts(XBRLFactsList cf, int index)
           
 java.lang.String getMapIdentifier()
           
 int getMulti()
           
 int getNumberOfValues()
           
 HasFacts getParent()
          Access to the parent of this template Fact.
 Section getSection()
           
 XBRLDataSource getSource()
           
 Fact.Type getType()
           
 XBRLUnit getUnit()
           
 net.sf.saxon.value.AtomicValue getValue(int index)
           
 int hashCode()
           
 void registerFact(Fact fact)
          Registers a new fact has been added to the container.
 void setSection(Section section)
           
 void unregisterFact(Fact fact)
          Same as HasFacts.registerFact(Fact) but in this case for removing the information stored
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
See Also:
Constant Field Values

SINGLE

public static final int SINGLE
See Also:
Constant Field Values

PREV

public static final int PREV
See Also:
Constant Field Values
Constructor Detail

Fact

public Fact(Fact.Type type,
            HasFacts parent,
            XBRLDataSource source,
            MapperContext context,
            java.lang.String mapIdentifier,
            XMLElementDefinition concept,
            XBRLUnit unit,
            int multi)
Parameters:
parent -
source -
context -
mapIdentifier -
concept -
unit -
multi -
Method Detail

getMulti

public int getMulti()
Returns:
the multi

getContext

public MapperContext getContext()
Returns:
the context

getSource

public XBRLDataSource getSource()
Returns:
the source

getMapIdentifier

public java.lang.String getMapIdentifier()
Returns:
the mapIdentifier

getConcept

public XMLElementDefinition getConcept()
The concept definition in the taxonomy that corresponds to this fact in the template

Returns:
the concept this is either an XBRLItem or XBRLTuple

getUnit

public XBRLUnit getUnit()
Returns:
the unit. If this is not a numeric unit or it is a tuple null is returned

getParent

public HasFacts getParent()
Access to the parent of this template Fact. This is another template fact (tuple) or the mapper instance (the template document). Note that Fact and Mapper implements the HasFacts interface.

Specified by:
getParent in interface HasFacts
Returns:
the parent of this Fact

getType

public Fact.Type getType()
Returns:
the type

getNumberOfValues

public int getNumberOfValues()
Returns:
Integer

getValue

public net.sf.saxon.value.AtomicValue getValue(int index)
                                        throws MapException
Parameters:
index -
Returns:
Value (Object in the Saxon library)
Throws:
MapException

getFacts

public java.util.Collection<XBRLFact> getFacts(XBRLFactsList cf,
                                               int index)
                                        throws MapException
Parameters:
cf -
index -
Returns:
a new XBRLFact
Throws:
MapException

getChildrenFacts

public java.util.Iterator<Fact> getChildrenFacts()
Description copied from interface: HasFacts
Access to an iterator over the children facts of this object

Specified by:
getChildrenFacts in interface HasFacts
Returns:
Iterator over children facts

addFact

public void addFact(Fact newFact)
Description copied from interface: HasFacts
Adds a new Fact to the end of the Facts container.

This method does not updates the taxonomy URLs.

Specified by:
addFact in interface HasFacts
Parameters:
newFact - the new fact to be added

addFactAt

public void addFactAt(Fact newFact,
                      int pos)
Description copied from interface: HasFacts
Adds a new Fact at the position indicated by pos.

Specified by:
addFactAt in interface HasFacts
Parameters:
newFact - Fact to be added
pos - integer. Zero based

delFact

public void delFact(Fact fact)
Description copied from interface: HasFacts
Removes a fact from the container

Specified by:
delFact in interface HasFacts
Parameters:
fact - Fact to remove

registerFact

public void registerFact(Fact fact)
Description copied from interface: HasFacts
Registers a new fact has been added to the container. This method updates the Hashtables in the instance template and passes UP to its parent the registration of facts for tuples. This method is called internally by the API and should not be called manually

Specified by:
registerFact in interface HasFacts

unregisterFact

public void unregisterFact(Fact fact)
Description copied from interface: HasFacts
Same as HasFacts.registerFact(Fact) but in this case for removing the information stored

Specified by:
unregisterFact in interface HasFacts

setSection

public void setSection(Section section)
Parameters:
section -

getSection

public Section getSection()
Returns:
the section

hashCode

public int hashCode()
Specified by:
hashCode in interface HasFacts
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface HasFacts
Overrides:
equals in class java.lang.Object


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