uk.ac.ic.doc.automed.reps
Class Network

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.reps.Network

public class Network
extends java.lang.Object


Constructor Summary
Network(Schema[][] paths)
          Constructs a directed network from the schema paths supplied.
Network(java.lang.String name, Schema[][] paths)
          Constructs a directed network from the schema paths supplied.
Network(java.lang.String name, Schema[][] paths, boolean directed, boolean maximal)
          Constructs a network from the schema paths supplied.
 
Method Summary
 boolean areRelativesMaximal()
           
 boolean contains(Node node)
          Returns whether or not the network contains the supplied node.
 boolean contains(Schema schema)
          Returns whether or not the network contains the supplied schema
 boolean contains(java.lang.String name)
          Returns whether or not the network contains the named schema
static Network[] getAllNetworks()
          Returns an array of all networks in the repository.
 Node[] getAllNodes()
           
 Node[] getLeafs()
           
 java.lang.String getName()
           
static Network getNetwork(Schema s, java.lang.String name)
          Returns the complete undirected network that contains schema s.
 Node getNode(Node node)
          Deprecated.  
 Node getNode(Schema schema)
          Returns the network node representing the supplied schema
 Node getNode(java.lang.String name)
          Returns the network node representing the named schema
 Node[] getRoots()
           
 boolean isCyclic()
           
 boolean isDirected()
           
 boolean isTree()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Network

public Network(Schema[][] paths)
        throws IntegrityException
Constructs a directed network from the schema paths supplied. Each path's first schema is a root of the network. Not sure what this will do if the paths don't all overlap. Note that the paths don't have to bear any relationship to the contents of the repository - most likely use is to represent a sub-network of a complete network.


Network

public Network(java.lang.String name,
               Schema[][] paths)
        throws IntegrityException
Constructs a directed network from the schema paths supplied. Not sure what this will do if the paths don't all overlap. Note that the paths don't have to bear any relationship to the contents of the repository - most likely use is to represent a sub-network of a complete network.

Parameters:
name - The name to give the network

Network

public Network(java.lang.String name,
               Schema[][] paths,
               boolean directed,
               boolean maximal)
        throws IntegrityException
Constructs a network from the schema paths supplied. Not sure what this will do if the paths don't all overlap. Note that the paths don't have to bear any relationship to the contents of the repository - most likely use is to represent a sub-network of a complete network.

Parameters:
name - The name to give the network
directed - Shoud the network be directed
maximal - If not directed, should each nodes parents and children be the empty set or the same as the adjacent set for the node
Method Detail

getName

public java.lang.String getName()

isDirected

public boolean isDirected()

isCyclic

public boolean isCyclic()

isTree

public boolean isTree()

areRelativesMaximal

public boolean areRelativesMaximal()

contains

public boolean contains(java.lang.String name)
Returns whether or not the network contains the named schema

Parameters:
name - The name of the schema
Returns:
true if the network contatins the schema, false otherwise

contains

public boolean contains(Schema schema)
Returns whether or not the network contains the supplied schema

Returns:
true if the network contatins the schema, false otherwise

contains

public boolean contains(Node node)
Returns whether or not the network contains the supplied node. Note that the network may contain the schema represented by the node but not contain the node - the node may represent the schema in a different network instance.

Parameters:
node - A node representing the schema to be tested
Returns:
true if the network contatins the node, false otherwise

getNode

public Node getNode(java.lang.String name)
Returns the network node representing the named schema

Parameters:
name - Name of the schema whose Node is to be returned
Returns:
The Node which represents the named schema

getNode

public Node getNode(Schema schema)
Returns the network node representing the supplied schema

Parameters:
schema - The schema whose Node is to be returned
Returns:
The Node which represents the supplied schema

getNode

public Node getNode(Node node)
Deprecated.  

Probably not the most useful method in the world, should return the parameter passed to it. Don't know why it's here


getAllNodes

public Node[] getAllNodes()

getRoots

public Node[] getRoots()

getLeafs

public Node[] getLeafs()

getAllNetworks

public static Network[] getAllNetworks()
Returns an array of all networks in the repository. The networks are undirected and together partition the repository (every schema in the repository will be in exactly one network)


getNetwork

public static Network getNetwork(Schema s,
                                 java.lang.String name)
Returns the complete undirected network that contains schema s.

Parameters:
s - The schema to trawl the network from
name - The name to give the new network or null for a default name
Returns:
The complete, undirected network containing schema s

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object