public class NetworkImpl extends java.lang.Object implements Network, java.io.Serializable
Constructor and Description |
---|
NetworkImpl(Store store,
java.lang.String linkRole,
java.lang.String arcrole) |
Modifier and Type | Method and Description |
---|---|
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(java.util.Collection<Relationship> relationships)
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(java.lang.String index) |
boolean |
equals(java.lang.Object obj) |
Fragment |
get(java.lang.String index) |
java.util.SortedSet<Relationship> |
getActiveRelationshipsFrom(java.lang.String index) |
java.util.SortedSet<Relationship> |
getActiveRelationshipsTo(java.lang.String index) |
java.util.List<Relationship> |
getAllActiveRelationships() |
java.util.List<Relationship> |
getAllRelationships() |
java.lang.String |
getArcrole() |
<F extends Fragment> |
getChildren(java.lang.String index) |
java.lang.String |
getLinkRole() |
int |
getNumberOfActiveRelationships() |
int |
getNumberOfRelationships() |
<F extends Fragment> |
getParents(java.lang.String index)
Note that a fragment can have more than one parent fragment given
that the networks are not just trees.
|
java.util.Set<java.lang.String> |
getRootFragmentIndices() |
<F extends Fragment> |
getRootFragments() |
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,EquivalentRelationships>> |
getSourceRelationships() |
Store |
getStore() |
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,EquivalentRelationships>> |
getTargetRelationships() |
boolean |
hasActiveRelationshipsFrom(java.lang.String index) |
boolean |
hasActiveRelationshipsTo(java.lang.String index) |
boolean |
hasFragment(java.lang.String index) |
int |
hashCode() |
boolean |
hasSingleParent(java.lang.String index) |
boolean |
isLeaf(java.lang.String index) |
boolean |
isRoot(java.lang.String index) |
void |
setArcrole(java.lang.String arcrole) |
void |
setLinkRole(java.lang.String linkRole) |
public NetworkImpl(Store store, java.lang.String linkRole, java.lang.String arcrole) throws XBRLException
store
- The data store.linkRole
- The link role defining the network.arcrole
- The arc role defining the network.XBRLException
- if the data store is null.public java.lang.String getArcrole()
getArcrole
in interface Network
Network.getArcrole()
public void setArcrole(java.lang.String arcrole) throws XBRLException
setArcrole
in interface Network
arcrole
- the arc role to set.XBRLException
- if the arc role is null.Network.setArcrole(String)
public java.lang.String getLinkRole()
getLinkRole
in interface Network
Network.getLinkRole()
public void setLinkRole(java.lang.String linkRole) throws XBRLException
setLinkRole
in interface Network
linkRole
- the linkRole to set.XBRLException
- if the link role is null.Network.setLinkRole(String)
public boolean hasFragment(java.lang.String index) throws XBRLException
hasFragment
in interface Network
index
- The index of the fragment to check.XBRLException
Network.hasFragment(String)
public Fragment get(java.lang.String index) throws XBRLException
get
in interface Network
index
- The index of the fragment to get from the set
of fragments already participating in the network.XBRLException
Network.get(String)
public <F extends Fragment> java.util.List<F> getRootFragments()
getRootFragments
in interface Network
F
- The type of fragment to use for the fragments in the list.Network.getRootFragments()
public java.util.Set<java.lang.String> getRootFragmentIndices()
getRootFragmentIndices
in interface Network
Network.getRootFragmentIndices()
public Store getStore()
getStore
in interface Network
Network.getStore()
public void addRelationship(Relationship relationship) throws XBRLException
Network
addRelationship
in interface Network
relationship
- The relationship to add.XBRLException
Network.addRelationship(Relationship)
public void addRelationships(java.util.Collection<Relationship> relationships) throws XBRLException
Network
addRelationships
in interface Network
relationships
- The relationship to add.XBRLException
Network.addRelationships(Collection)
public java.util.SortedSet<Relationship> getActiveRelationshipsFrom(java.lang.String index) throws XBRLException
getActiveRelationshipsFrom
in interface Network
index
- The index of the source fragment.XBRLException
Network.getActiveRelationshipsFrom(String)
public boolean hasSingleParent(java.lang.String index) throws XBRLException
hasSingleParent
in interface Network
index
- the index of the fragment.XBRLException
Network.hasSingleParent(String)
public boolean isRoot(java.lang.String index) throws XBRLException
isRoot
in interface Network
index
- the index of the fragment.XBRLException
Network.isRoot(String)
public boolean isLeaf(java.lang.String index) throws XBRLException
isLeaf
in interface Network
index
- the index of the fragment.XBRLException
Network.isLeaf(String)
public boolean hasActiveRelationshipsFrom(java.lang.String index)
hasActiveRelationshipsFrom
in interface Network
index
- The index of the fragment to check.Network.hasActiveRelationshipsFrom(String)
public boolean hasActiveRelationshipsTo(java.lang.String index)
hasActiveRelationshipsTo
in interface Network
index
- The index of the fragment to check.Network.hasActiveRelationshipsTo(String)
public java.util.SortedSet<Relationship> getActiveRelationshipsTo(java.lang.String index) throws XBRLException
getActiveRelationshipsTo
in interface Network
index
- The index of the target fragment.XBRLException
Network.getActiveRelationshipsTo(String)
public <F extends Fragment> java.util.List<F> getChildren(java.lang.String index) throws XBRLException
getChildren
in interface Network
F
- The type of org.xbrlapi.Fragmentindex
- The parent fragment indexXBRLException
Network.getChildren(String)
public <F extends Fragment> java.util.List<F> getParents(java.lang.String index) throws XBRLException
Network
getParents
in interface Network
F
- The type of org.xbrlapi.Fragmentindex
- The child fragment indexXBRLException
Network.getParents(String)
public int getNumberOfRelationships()
getNumberOfRelationships
in interface Network
Network.getNumberOfRelationships()
public int getNumberOfActiveRelationships()
getNumberOfActiveRelationships
in interface Network
Network.getNumberOfActiveRelationships()
public void complete() throws XBRLException
Network
complete
in interface Network
XBRLException
Network.complete()
public boolean contains(java.lang.String index)
contains
in interface Network
index
- The index of the fragment to check for in the
network.Network.contains(String)
public java.util.List<Relationship> getAllRelationships() throws XBRLException
getAllRelationships
in interface Network
XBRLException
Network.getAllRelationships()
public java.util.List<Relationship> getAllActiveRelationships() throws XBRLException
getAllActiveRelationships
in interface Network
XBRLException
Network.getAllActiveRelationships()
public void add(Network network) throws XBRLException
Network
add
in interface Network
network
- The network to be merged into this
network.XBRLException
Network.add(Network)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,EquivalentRelationships>> getSourceRelationships()
public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,EquivalentRelationships>> getTargetRelationships()