com.ihr.xbrl.dts
Class PDimension

java.lang.Object
  extended by com.ihr.xbrl.dts.PDimension
All Implemented Interfaces:
Dimension<MemberInfo>

public class PDimension
extends java.lang.Object
implements Dimension<MemberInfo>

Used to represent a hierarchical structure on the Primary Item. This is the domain-member structure of elements that can be found starting on the item passed as the constructor following the rules of the XDT specification in regard to the use of the targetRole attribute.

TODO: Note: not usable members are added to the domain. revisit later

Author:
Ignacio

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ihr.xbrl.dts.Dimension
Dimension.DimensionType
 
Field Summary
 
Fields inherited from interface com.ihr.xbrl.dts.Dimension
defaultDimensionsXBRL, duplicatesDimension, formLineDimenion, identifierDimension, instantModeDimension, periodDimension, POSITION_AVAIL, POSITION_COLUMN_HEADERS, POSITION_ROW_HEADERS, RSDimensionsNameNamespace
 
Constructor Summary
PDimension(XDTPrimaryItem pItem, XBRLRoleType role)
           
 
Method Summary
 boolean addMember(Member<?> member)
          Adds a new dimension member to the end of the members of this dimension.
 boolean bHasFixedName()
          This function returns true if the dimension has a fixed name that must be obtained via a call to Dimension.getDimensionName()
 boolean delMember(Member<?> member)
          Removes an existing dimension member from the dimension domain.
 boolean factMatches(XDTFactWithVirtualDimensions item, Member<?> mem, java.util.HashSet<javax.xml.namespace.QName> dimensionsToMatch)
           
 Member<?> findMember(Member<?> mem)
          Search the Dimension domain for an occurrence of the mem member.
 Member<?> getDefault()
          for explicit dimensions this function returns the default member if any is defined
 java.lang.String getDimensionName()
          This function will be used to obtain a dimension name for things that does not have a label like the Period dimension or the Identifier dimension.
 java.util.Collection<Member<?>> getDomain()
          Returns an ordered collection of members.
 java.util.Collection<Member<?>> getMembers()
          Returns an ordered collection of members.
 javax.xml.namespace.QName getName()
          Every Dimension must have a dimension QName.
static javax.xml.namespace.QName getName(XDTPrimaryItem pri)
           
 XBRLItem getParentItem()
           
 int getSuggestedInitialPosition(javax.xml.namespace.QName selectedPrimaryItem)
          Returns the suggested initial placement position of the graphical element in the GUI.
 Dimension.DimensionType getType()
          returns either com.ihr.xbrl.om.xdt.XDTDimension.TYPED, com.ihr.xbrl.om.xdt.XDTDimension.EXPLICIT depending on the type of the surrounding dimension.
 boolean isPrimary()
          Returns true if the dimension is linked with a primary item and thus it is a PDimension or a DDimension
 boolean isTree()
          Returns true if the representation of this dimension could be a tree of elements or false if it is a list of items
 void setAllowDuplicates(boolean allowDuplicates)
          If the value is true then it is possible for the dimension to contain two identical members as two different member values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ihr.xbrl.dts.Dimension
equals, hashCode
 

Constructor Detail

PDimension

public PDimension(XDTPrimaryItem pItem,
                  XBRLRoleType role)
           throws com.rs.lic.LicenseVerificationException,
                  XBRLValidationException
Parameters:
pri -
role -
Throws:
XBRLValidationException
com.rs.lic.LicenseVerificationException
Method Detail

getParentItem

public XBRLItem getParentItem()

addMember

public boolean addMember(Member<?> member)
Description copied from interface: Dimension
Adds a new dimension member to the end of the members of this dimension. returns true if the member is new, false if the member already exist

Specified by:
addMember in interface Dimension<MemberInfo>

delMember

public boolean delMember(Member<?> member)
Description copied from interface: Dimension
Removes an existing dimension member from the dimension domain.

Specified by:
delMember in interface Dimension<MemberInfo>
Parameters:
member - the member to remove

bHasFixedName

public boolean bHasFixedName()
Description copied from interface: Dimension
This function returns true if the dimension has a fixed name that must be obtained via a call to Dimension.getDimensionName()

Specified by:
bHasFixedName in interface Dimension<MemberInfo>
Returns:
boolean

getDimensionName

public java.lang.String getDimensionName()
Description copied from interface: Dimension
This function will be used to obtain a dimension name for things that does not have a label like the Period dimension or the Identifier dimension.

Specified by:
getDimensionName in interface Dimension<MemberInfo>
Returns:
String

getSuggestedInitialPosition

public int getSuggestedInitialPosition(javax.xml.namespace.QName selectedPrimaryItem)
Description copied from interface: Dimension
Returns the suggested initial placement position of the graphical element in the GUI. This value is a constant defined in this interface

Specified by:
getSuggestedInitialPosition in interface Dimension<MemberInfo>
Parameters:
selectedPrimaryItem - this is the selected primary item in the GUI
Returns:
integer constant defined in this interface

setAllowDuplicates

public void setAllowDuplicates(boolean allowDuplicates)
Description copied from interface: Dimension
If the value is true then it is possible for the dimension to contain two identical members as two different member values. If the value is false, a call to a method addMember will always check the existence of the member before the member is added to the dimension

Specified by:
setAllowDuplicates in interface Dimension<MemberInfo>

getMembers

public java.util.Collection<Member<?>> getMembers()
Description copied from interface: Dimension
Returns an ordered collection of members. If the members are hierarchically organized then the ordering includes parents first, when a parent has children, then the list of children from the first one to the last one then the parent continues.

Specified by:
getMembers in interface Dimension<MemberInfo>
Returns:
Collection of members

isTree

public boolean isTree()
Description copied from interface: Dimension
Returns true if the representation of this dimension could be a tree of elements or false if it is a list of items

Specified by:
isTree in interface Dimension<MemberInfo>
Returns:
boolean value (never calculated)

getDomain

public java.util.Collection<Member<?>> getDomain()
Description copied from interface: Dimension
Returns an ordered collection of members. If the members are hierarchically organized then the ordering includes only the parent elements.

Specified by:
getDomain in interface Dimension<MemberInfo>
Returns:
Collection of members

isPrimary

public boolean isPrimary()
Description copied from interface: Dimension
Returns true if the dimension is linked with a primary item and thus it is a PDimension or a DDimension

Specified by:
isPrimary in interface Dimension<MemberInfo>
Returns:
boolean value

factMatches

public boolean factMatches(XDTFactWithVirtualDimensions item,
                           Member<?> mem,
                           java.util.HashSet<javax.xml.namespace.QName> dimensionsToMatch)
Specified by:
factMatches in interface Dimension<MemberInfo>
Returns:

getDefault

public Member<?> getDefault()
Description copied from interface: Dimension
for explicit dimensions this function returns the default member if any is defined

Specified by:
getDefault in interface Dimension<MemberInfo>
Returns:

getName

public javax.xml.namespace.QName getName()
Description copied from interface: Dimension
Every Dimension must have a dimension QName.

Specified by:
getName in interface Dimension<MemberInfo>
Returns:
QName

getName

public static javax.xml.namespace.QName getName(XDTPrimaryItem pri)

findMember

public Member<?> findMember(Member<?> mem)
Description copied from interface: Dimension
Search the Dimension domain for an occurrence of the mem member. If found. the found member is returned. otherwise null is returned

Specified by:
findMember in interface Dimension<MemberInfo>
Parameters:
mem - the member to search on this dimension domain
Returns:
the member found or null

getType

public Dimension.DimensionType getType()
Description copied from interface: Dimension
returns either com.ihr.xbrl.om.xdt.XDTDimension.TYPED, com.ihr.xbrl.om.xdt.XDTDimension.EXPLICIT depending on the type of the surrounding dimension. Also returns -1 if the dimension is the primary item or a pre defined dimension in XBRL as the time dimension or the company dimension

Specified by:
getType in interface Dimension<MemberInfo>
Returns:
integer constant defined in com.ihr.xbrl.om.xdt.XDTDimension class


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