src/ADT/Graph/Weighted.php
public function toTable( $showNull = false)
	{
		$heading = "";
		$t = "<table class='filledframe' cellpadding=2 cellspacing=0>";
		$nodes = $this->getNodes();
		for( $j=0; $j<$this->getNodeSize(); $j++ )
		{
			$target = $nodes[$j];
			$heading .= "<th width=20>".$target->getNodeName()."</th>";
		}
		$t .= "<tr><th></th>".$heading."</tr>";
		for( $i=0; $i<$this->getNodeSize(); $i++ )
		{
			$source = $nodes[$i];
			$line = "";
			for( $j=0; $j<$this->getNodeSize(); $j++ )
			{

				$target = $nodes[$j];
				if( $this->isEdge( $source, $target ) )
					$value = $this->getEdgeValue( $source, $target );
				else if( $showNull )
					$value = 0;
				else
					$value = "";
				$line .= "<td align=center>".$value."</td>";
			}
			$t .= "<tr><th width=20>".$source->getNodeName()."</th>".$line."</tr>";
		}
		$t .= "</table>";
		return $t;
	}
public function toTable( $showNull = false)
	{
		$heading = "";
		$t = "<table class='filledframe' cellpadding=2 cellspacing=0>";
		$nodes = $this->getNodes();
		for( $j=0; $j<$this->getNodeSize(); $j++ )
		{
			$target = $nodes[$j];
			$heading .= "<th width=20>".$target->getNodeName()."</th>";
		}
		$t .= "<tr><th></th>".$heading."</tr>";
		for( $i=0; $i<$this->getNodeSize(); $i++ )
		{
			$source = $nodes[$i];
			$line = "";
			for( $j=0; $j<$this->getNodeSize(); $j++ )
			{

				$target = $nodes[$j];
				if( $this->isEdge( $source, $target ) )
					$value = $this->getEdgeValue( $source, $target );
				else if( $showNull )
					$value = 0;
				else
					$value = "";
				$line .= "<td align=center>".$value."</td>";
			}
			$t .= "<tr><th width=20>".$source->getNodeName()."</th>".$line."</tr>";
		}
		$t .= "</table>";
		return $t;
	}
public function toTable ( $ showNull = false ) { $ heading = "" ; $ t = "<table class='filledframe' cellpadding=2 cellspacing=0>" ; $ nodes = $ this -> getNodes ( ) ; for ( $ j = 0 ; $ j < $ this -> getNodeSize ( ) ; $ j ++ ) { $ target = $ nodes [ $ j ] ; $ heading .= "<th width=20>" . $ target -> getNodeName ( ) . "</th>" ; } $ t .= "<tr><th></th>" . $ heading . "</tr>" ; for ( $ i = 0 ; $ i < $ this -> getNodeSize ( ) ; $ i ++ ) { $ source = $ nodes [ $ i ] ; $ line = "" ; for ( $ j = 0 ; $ j < $ this -> getNodeSize ( ) ; $ j ++ ) { $ target = $ nodes [ $ j ] ; if ( $ this -> isEdge ( $ source , $ target ) ) $ value = $ this -> getEdgeValue ( $ source , $ target ) ; else if ( $ showNull ) $ value = 0 ; else $ value = "" ; $ line .= "<td align=center>" . $ value . "</td>" ; } $ t .= "<tr><th width=20>" . $ source -> getNodeName ( ) . "</th>" . $ line . "</tr>" ; } $ t .= "</table>" ; return $ t ; }
Returns all nodes and edges of this graph as HTML-table.
@access		public
@param		bool		$showNull		flag: show Zero
@return		string
Returns all nodes and edges of this graph as HTML - table .