XBRLAPI

A Java API for XBRL


org.xbrlapi.networks
Interface Network

All Known Implementing Classes:
NetworkImpl

public interface Network

The network interface combines relationships that are not prohibited and that are not over-ridden and that:

Author:
Geoffrey Shuetrim (geoff@galexy.net)

Method Summary
 void add(Network network)
          Adds relationships from the supplied network to this network where they are not already included.
 void addRelationship(Relationship relationship)
          Adds the relationship to the network.
 void addRelationships(Collection<Relationship> relationship)
          Adds the set of relationships to the network.
 void complete()
          Complete the network, finding all active relationships in the data store that participate in the network.
 boolean contains(String index)
           
 Fragment get(String index)
           
 SortedSet<Relationship> getActiveRelationshipsFrom(String index)
           
 SortedSet<Relationship> getActiveRelationshipsTo(String index)
           
 List<Relationship> getAllActiveRelationships()
           
 List<Relationship> getAllRelationships()
           
 URI getArcrole()
           
<F extends Fragment>
List<F>
getChildren(String index)
           
 URI getLinkRole()
           
 int getNumberOfActiveRelationships()
           
 int getNumberOfRelationships()
           
<F extends Fragment>
List<F>
getParents(String index)
          Note that a fragment can have more than one parent fragment given that the networks are not just trees.
 Set<String> getRootFragmentIndices()
           
<F extends Fragment>
List<F>
getRootFragments()
           
 Store getStore()
           
 boolean hasActiveRelationshipsFrom(String index)
           
 boolean hasActiveRelationshipsTo(String index)
           
 boolean hasFragment(String index)
           
 boolean hasSingleParent(String index)
           
 boolean isLeaf(String index)
           
 boolean isRoot(String index)
           
 void setArcrole(URI arcrole)
           
 void setLinkRole(URI linkRole)
           
 

Method Detail

getStore

Store getStore()
Returns:
The data store that contains the network information.

getArcrole

URI getArcrole()
Returns:
the arc role.

setArcrole

void setArcrole(URI arcrole)
                throws XBRLException
Parameters:
arcrole - the arc role to set.
Throws:
XBRLException - if the arc role is null.

getLinkRole

URI getLinkRole()
Returns:
the link role.

setLinkRole

void setLinkRole(URI linkRole)
                 throws XBRLException
Parameters:
linkRole - the linkRole to set.
Throws:
XBRLException - if the link role is null.

hasFragment

boolean hasFragment(String index)
                    throws XBRLException
Parameters:
index - The index of the fragment to check.
Returns:
true if the fragment with the supplied index is already included in the set of fragments participating in the network.
Throws:
XBRLException

hasActiveRelationshipsFrom

boolean hasActiveRelationshipsFrom(String index)
Parameters:
index - The index of the fragment to check.
Returns:
true if the network contains active relationships from the specified fragment and false otherwise.

hasSingleParent

boolean hasSingleParent(String index)
                        throws XBRLException
Parameters:
index - the index of the fragment.
Returns:
true if the fragment with the given index has a single parent fragment in the network and false otherwise.
Throws:
XBRLException

isRoot

boolean isRoot(String index)
               throws XBRLException
Parameters:
index - the index of the fragment.
Returns:
true if the fragment with the given index has no parent fragments and false otherwise.
Throws:
XBRLException

isLeaf

boolean isLeaf(String index)
               throws XBRLException
Parameters:
index - the index of the fragment.
Returns:
true if the fragment with the given index has no child fragments in the network and false otherwise.
Throws:
XBRLException

hasActiveRelationshipsTo

boolean hasActiveRelationshipsTo(String index)
Parameters:
index - The index of the fragment to check.
Returns:
true if the network contains active relationships to the specified fragment and false otherwise.

get

Fragment get(String index)
             throws XBRLException
Parameters:
index - The index of the fragment to get from the set of fragments already participating in the network.
Returns:
The requested fragment or null if the fragment is not already included in the set of fragments stored by the network.
Throws:
XBRLException

getRootFragments

<F extends Fragment> List<F> getRootFragments()
Type Parameters:
F - The type of fragment to use for the fragments in the list.
Returns:
a list of the fragments in the network that are roots in the sense that they are sources of relationships but not targets of relationships.

getRootFragmentIndices

Set<String> getRootFragmentIndices()
Returns:
a list of the indexes of the fragments in the network that are roots in the sense that they are sources of relationships but not targets of relationships.

addRelationship

void addRelationship(Relationship relationship)
                     throws XBRLException
Adds the relationship to the network. If the relationship has already been recorded in the network, then it is not added again because that would be redundant and potentially confusing.

Parameters:
relationship - The relationship to add.
Throws:
XBRLException

addRelationships

void addRelationships(Collection<Relationship> relationship)
                      throws XBRLException
Adds the set of relationships to the network.

Parameters:
relationship - The relationship to add.
Throws:
XBRLException

getActiveRelationshipsFrom

SortedSet<Relationship> getActiveRelationshipsFrom(String index)
                                                   throws XBRLException
Parameters:
index - The index of the source fragment.
Returns:
the relationships that override or prohibit all other equivalent relationships in the network and that run from the same source fragment. The list is ordered by the order attributes on the relationships from lowest to highest.
Throws:
XBRLException

getActiveRelationshipsTo

SortedSet<Relationship> getActiveRelationshipsTo(String index)
                                                 throws XBRLException
Parameters:
index - The index of the target fragment.
Returns:
the relationships that override or prohibit all other equivalent relationships in the network and that run to the same target fragment.
Throws:
XBRLException

getAllRelationships

List<Relationship> getAllRelationships()
                                       throws XBRLException
Returns:
the list of all relationships (active and inactive) in the network.
Throws:
XBRLException

getAllActiveRelationships

List<Relationship> getAllActiveRelationships()
                                             throws XBRLException
Returns:
the list of all active relationships in the network.
Throws:
XBRLException

getChildren

<F extends Fragment> List<F> getChildren(String index)
                                     throws XBRLException
Type Parameters:
F - The type of org.xbrlapi.Fragment
Parameters:
index - The parent fragment index
Returns:
the list of children fragments for the specified parent fragment, or an empty list if there are no children fragments.
Throws:
XBRLException

getParents

<F extends Fragment> List<F> getParents(String index)
                                    throws XBRLException
Note that a fragment can have more than one parent fragment given that the networks are not just trees.

Type Parameters:
F - The type of org.xbrlapi.Fragment
Parameters:
index - The child fragment index
Returns:
the list of parent fragments for the specified child fragment, or an empty list if there are no parent fragments.
Throws:
XBRLException

getNumberOfRelationships

int getNumberOfRelationships()
Returns:
the number of relationships (active or otherwise) in the network.

getNumberOfActiveRelationships

int getNumberOfActiveRelationships()
Returns:
the number of active relationships in the network.

complete

void complete()
              throws XBRLException
Complete the network, finding all active relationships in the data store that participate in the network.

Throws:
XBRLException

contains

boolean contains(String index)
Parameters:
index - The index of the fragment to check for in the network.
Returns:
true if the fragment is in the network and false otherwise.

add

void add(Network network)
         throws XBRLException
Adds relationships from the supplied network to this network where they are not already included.

Parameters:
network - The network to be merged into this network.
Throws:
XBRLException

Get Java XBRL API implementation at SourceForge.net.