<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Structures_Graph_Node</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Structures_Graph_Node</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
			</div>
	<div class="info-box-body">
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The Structures_Graph_Node class represents a Node that can be member of a  graph node set.</p>
<p class="description"><p>A graph node can contain data. Under this API, the node contains default data,  and key index data. It behaves, thus, both as a regular data node, and as a  dictionary (or associative array) node.</p><p>Regular data is accessed via getData and setData. Key indexed data is accessed  via getMetadata and setMetadata.</p></p>
	<ul class="tags">
				<li><span class="field">copyright:</span> (c) 2004 by Sérgio Carvalho</li>
				<li><span class="field">author:</span> Sérgio Carvalho &lt;<a href="mailto:sergio.carvalho@portugalmail.com">mailto:sergio.carvalho@portugalmail.com</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Structures_Graph_Node_php.html">/Structures/Graph/Node.php</a> (line <span class="field">57</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
									<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">Structures_Graph_Node</span>
										<a href="#Structures_Graph_Node" title="details" class="method-name">Structures_Graph_Node</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#connectsTo" title="details" class="method-name">connectsTo</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$target</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#connectTo" title="details" class="method-name">connectTo</a>
											(<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$destinationNode</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#getData" title="details" class="method-name">&amp;getData</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
										<a href="#getGraph" title="details" class="method-name">&amp;getGraph</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#getMetadata" title="details" class="method-name">&amp;getMetadata</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$nullIfNonexistent</span> = <span class="var-default">false</span>])
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getNeighbours" title="details" class="method-name">getNeighbours</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#inDegree" title="details" class="method-name">inDegree</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#metadataKeyExists" title="details" class="method-name">metadataKeyExists</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">integer</span>
										<a href="#outDegree" title="details" class="method-name">outDegree</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#setData" title="details" class="method-name">setData</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setGraph" title="details" class="method-name">setGraph</a>
											(<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$graph</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setMetadata" title="details" class="method-name">setMetadata</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#unsetMetadata" title="details" class="method-name">unsetMetadata</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
									</div>
							</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodStructures_Graph_Node" id="Structures_Graph_Node"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor Structures_Graph_Node</span> (line <span class="line-number">78</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Structures_Graph_Node</span>
		<span class="method-name">
			Structures_Graph_Node
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodconnectsTo" id="connectsTo"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">connectsTo</span> (line <span class="line-number">275</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Test wether this node has an arc to the target node</p>
	<ul class="tags">
				<li><span class="field">return:</span> True if the two nodes are connected</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			connectsTo
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">&$target</span>)
			</div>
	
		
		
	</div>
<a name="methodconnectTo" id="connectTo"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">connectTo</span> (line <span class="line-number">236</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Connect this node to another one.</p>
<p class="description"><p>If the graph is not directed, the reverse arc, connecting $destinationNode to $this is also created.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			connectTo
		</span>
					(<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$destinationNode</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
				<span class="var-name">&$destinationNode</span><span class="var-description">: Node to connect to</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetData" id="getData"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getData</span> (line <span class="line-number">119</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Node data getter.</p>
<p class="description"><p>Each graph node can contain a reference to one variable. This is the getter for that reference.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Data stored in node</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			&amp;getData
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetGraph" id="getGraph"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getGraph</span> (line <span class="line-number">90</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Node graph getter</p>
	<ul class="tags">
				<li><span class="field">return:</span> Graph where node is stored</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
		<span class="method-name">
			&amp;getGraph
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetMetadata" id="getMetadata"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getMetadata</span> (line <span class="line-number">171</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Node metadata getter</p>
<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an  associative array or in a dictionary. This method gets the data under the given key. If the key does  not exist, an error will be thrown, so testing using metadataKeyExists might be needed.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Metadata Data stored in node under given key</li>
				<li><span class="field">access:</span> public</li>
				<li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph_Node.html#methodmetadataKeyExists">Structures_Graph_Node::metadataKeyExists()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			&amp;getMetadata
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$nullIfNonexistent</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span><span class="var-description">: Key</span>			</li>
					<li>
				<span class="var-type">boolean</span>
				<span class="var-name">$nullIfNonexistent</span><span class="var-description">: nullIfNonexistent (defaults to false).</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetNeighbours" id="getNeighbours"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getNeighbours</span> (line <span class="line-number">262</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return nodes connected to this one.</p>
	<ul class="tags">
				<li><span class="field">return:</span> Array of nodes</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getNeighbours
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodinDegree" id="inDegree"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">inDegree</span> (line <span class="line-number">309</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Calculate the in degree of the node.</p>
<p class="description"><p>The indegree for a node is the number of arcs entering the node. For non directed graphs,  the indegree is equal to the outdegree.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> In degree of the node</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			inDegree
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodmetadataKeyExists" id="metadataKeyExists"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">metadataKeyExists</span> (line <span class="line-number">151</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Test for existence of metadata under a given key.</p>
<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an  associative array or in a dictionary. This method tests whether a given metadata key exists for this node.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			metadataKeyExists
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span><span class="var-description">: Key to test</span>			</li>
				</ul>
		
		
	</div>
<a name="methodoutDegree" id="outDegree"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">outDegree</span> (line <span class="line-number">333</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Calculate the out degree of the node.</p>
<p class="description"><p>The outdegree for a node is the number of arcs exiting the node. For non directed graphs,  the outdegree is always equal to the indegree.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Out degree of the node</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">integer</span>
		<span class="method-name">
			outDegree
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodsetData" id="setData"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setData</span> (line <span class="line-number">134</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Node data setter</p>
<p class="description"><p>Each graph node can contain a reference to one variable. This is the setter for that reference.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Data to store in node</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			setData
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
		
		
	</div>
<a name="methodsetGraph" id="setGraph"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setGraph</span> (line <span class="line-number">104</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Node graph setter. This method should not be called directly. Use Graph::addNode instead.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
				<li><span class="field">see:</span> <a href="../Structures_Graph/Structures_Graph.html#methodaddNode">Structures_Graph::addNode()</a></li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setGraph
		</span>
					(<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>&nbsp;<span class="var-name">&$graph</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../Structures_Graph/Structures_Graph.html">Structures_Graph</a></span>
				<span class="var-name">&$graph</span><span class="var-description">: Set the graph for this node.</span>			</li>
				</ul>
		
		
	</div>
<a name="methodsetMetadata" id="setMetadata"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setMetadata</span> (line <span class="line-number">214</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Node metadata setter</p>
<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an  associative array or in a dictionary. This method stores data under the given key. If the key already exists,  previously stored data is discarded.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setMetadata
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">mixed</span>&nbsp;<span class="var-name">$data</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span><span class="var-description">: Key</span>			</li>
					<li>
				<span class="var-type">mixed</span>
				<span class="var-name">$data</span><span class="var-description">: Data</span>			</li>
				</ul>
		
		
	</div>
<a name="methodunsetMetadata" id="unsetMetadata"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">unsetMetadata</span> (line <span class="line-number">196</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Delete metadata by key</p>
<p class="description"><p>Each graph node can contain multiple 'metadata' entries, each stored under a different key, as in an  associative array or in a dictionary. This method removes any data that might be stored under the provided key.  If the key does not exist, no error is thrown, so it is safe using this method without testing for key existence.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			unsetMetadata
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$key</span><span class="var-description">: Key</span>			</li>
				</ul>
		
		
	</div>
						
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Fri, 30 Jan 2004 16:37:29 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
	</p>
	</div></body>
</html>