Class DefaultNetwork

  • All Implemented Interfaces:
    Network

    public class DefaultNetwork
    extends java.lang.Object
    implements Network
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultNetwork()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object createEdge​(java.lang.Object source, java.lang.Object target)
      Creates a new edge object
      java.lang.Object createNode()
      Creates a new node object
      java.util.Iterator edges()
      Retrieve an iterator to the collection of egdes this network has
      java.util.Iterator edgesConnecting​(java.lang.Object source, java.lang.Object target)
      Returns all edges connecting source and target nodes
      java.lang.Object firstInEdge​(java.lang.Object node)
      Returns the first ingoing edge for this node, if any.
      java.lang.Object firstOutEdge​(java.lang.Object node)
      Returns the first outgoing edge for this node, if any.
      java.lang.Object getSource​(java.lang.Object edge)
      Get the source node of an edge
      java.lang.Object getTarget​(java.lang.Object edge)
      Get the target node of an edge
      java.util.Iterator inEdges​(java.lang.Object node)
      Returns all ingoing edges of this node.
      java.lang.Object nextInEdge​(java.lang.Object edge)
      Returns the next edge (in insertion order) connecting source and target node, if any.
      java.lang.Object nextOutEdge​(java.lang.Object edge)
      Returns the next edge (in insertion order) that is outgoing of target node, if any.
      java.util.Iterator nodes()
      Retrieve an iterator to the collection of nodes this network has
      java.lang.Integer nodesSize()
      How many nodes this network has
      java.lang.Object opposite​(java.lang.Object edge, java.lang.Object node)
      Returns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.
      java.util.Iterator outEdges​(java.lang.Object node)
      Returns all outgoing edges of this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultNetwork

        public DefaultNetwork()
    • Method Detail

      • createNode

        public java.lang.Object createNode()
        Description copied from interface: Network
        Creates a new node object
        Specified by:
        createNode in interface Network
        Returns:
        node
      • createEdge

        public java.lang.Object createEdge​(java.lang.Object source,
                                           java.lang.Object target)
        Description copied from interface: Network
        Creates a new edge object
        Specified by:
        createEdge in interface Network
        Parameters:
        source - - the source node
        target - - the target node
        Returns:
        edge
      • getSource

        public java.lang.Object getSource​(java.lang.Object edge)
        Description copied from interface: Network
        Get the source node of an edge
        Specified by:
        getSource in interface Network
        Parameters:
        edge - - the edge to get the source of
        Returns:
        node
      • getTarget

        public java.lang.Object getTarget​(java.lang.Object edge)
        Description copied from interface: Network
        Get the target node of an edge
        Specified by:
        getTarget in interface Network
        Parameters:
        edge - - the edge to get the target of
        Returns:
        node
      • nodes

        public java.util.Iterator nodes()
        Description copied from interface: Network
        Retrieve an iterator to the collection of nodes this network has
        Specified by:
        nodes in interface Network
        Returns:
        nodes[]
      • nodesSize

        public java.lang.Integer nodesSize()
        Description copied from interface: Network
        How many nodes this network has
        Specified by:
        nodesSize in interface Network
        Returns:
        number of nodes
      • edges

        public java.util.Iterator edges()
        Description copied from interface: Network
        Retrieve an iterator to the collection of egdes this network has
        Specified by:
        edges in interface Network
        Returns:
        edges[]
      • inEdges

        public java.util.Iterator inEdges​(java.lang.Object node)
        Description copied from interface: Network
        Returns all ingoing edges of this node.
        Specified by:
        inEdges in interface Network
        Returns:
        edge[]
      • outEdges

        public java.util.Iterator outEdges​(java.lang.Object node)
        Description copied from interface: Network
        Returns all outgoing edges of this node.
        Specified by:
        outEdges in interface Network
        Returns:
        edge[]
      • firstInEdge

        public java.lang.Object firstInEdge​(java.lang.Object node)
        Description copied from interface: Network
        Returns the first ingoing edge for this node, if any.
        Specified by:
        firstInEdge in interface Network
        Returns:
        {edge|null}
      • firstOutEdge

        public java.lang.Object firstOutEdge​(java.lang.Object node)
        Description copied from interface: Network
        Returns the first outgoing edge for this node, if any.
        Specified by:
        firstOutEdge in interface Network
        Returns:
        {edge|null}
      • nextInEdge

        public java.lang.Object nextInEdge​(java.lang.Object edge)
        Description copied from interface: Network
        Returns the next edge (in insertion order) connecting source and target node, if any.
        Specified by:
        nextInEdge in interface Network
        Parameters:
        edge - - the edge for which to retrieve incoming edges
        Returns:
        {edge|null}
      • nextOutEdge

        public java.lang.Object nextOutEdge​(java.lang.Object edge)
        Description copied from interface: Network
        Returns the next edge (in insertion order) that is outgoing of target node, if any.
        Specified by:
        nextOutEdge in interface Network
        Parameters:
        edge - - the edge for which to retrieve outgoing edges
        Returns:
        {edge|null}
      • edgesConnecting

        public java.util.Iterator edgesConnecting​(java.lang.Object source,
                                                  java.lang.Object target)
        Description copied from interface: Network
        Returns all edges connecting source and target nodes
        Specified by:
        edgesConnecting in interface Network
        Parameters:
        source - - the source node
        target - - the target node
        Returns:
        a collection iterator of edges
      • opposite

        public java.lang.Object opposite​(java.lang.Object edge,
                                         java.lang.Object node)
        Description copied from interface: Network
        Returns the edge going in opposite direction of this edge in insertion order, respectively to the given node, if any.
        Specified by:
        opposite in interface Network
        node - - the node for which to get the opposite node
        Returns:
        {Node}