src/ADT/Graph/EdgeSet.php
public function addEdge( $sourceNode, $targetNode, $value = NULL )
	{
		if( $this->isEdge( $sourceNode, $targetNode ) )
		{
			$edge	= $this->getEdge( $sourceNode, $targetNode );
 			if( $value == $edge->getEdgeValue( $sourceNode, $targetNode ) )
				throw new InvalidArgumentException( 'Edge is already set.' );
			else
				$this->removeEdge( $sourceNode, $targetNode );
		}
		$newEdge = new ADT_Graph_Edge( $sourceNode, $targetNode, $value );
		$this->edges[] = $newEdge;
		return $newEdge;
	}
public function addEdge( $sourceNode, $targetNode, $value = NULL )
	{
		if( $this->isEdge( $sourceNode, $targetNode ) )
		{
			$edge	= $this->getEdge( $sourceNode, $targetNode );
 			if( $value == $edge->getEdgeValue( $sourceNode, $targetNode ) )
				throw new InvalidArgumentException( 'Edge is already set.' );
			else
				$this->removeEdge( $sourceNode, $targetNode );
		}
		$newEdge = new ADT_Graph_Edge( $sourceNode, $targetNode, $value );
		$this->edges[] = $newEdge;
		return $newEdge;
	}
public function addEdge ( $ sourceNode , $ targetNode , $ value = NULL ) { if ( $ this -> isEdge ( $ sourceNode , $ targetNode ) ) { $ edge = $ this -> getEdge ( $ sourceNode , $ targetNode ) ; if ( $ value == $ edge -> getEdgeValue ( $ sourceNode , $ targetNode ) ) throw new InvalidArgumentException ( 'Edge is already set.' ) ; else $ this -> removeEdge ( $ sourceNode , $ targetNode ) ; } $ newEdge = new ADT_Graph_Edge ( $ sourceNode , $ targetNode , $ value ) ; $ this -> edges [ ] = $ newEdge ; return $ newEdge ; }
Adds a new Edge and returns reference of this Edge.
@access		public
@param		ADT_Graph_Node		$sourceNode		Source Node of this Edge
@param		ADT_Graph_Node		$targetNode		Target Node of this Edge
@param		int					$value			Value of this Edge
@return 	ADT_Graph_Node
Adds a new Edge and returns reference of this Edge .