de.aitools.aq.graph.weighted.concrete
Class ConcreteUndirectedLongGraph

java.lang.Object
  extended by de.aitools.aq.graph.weighted.concrete.ConcreteUndirectedLongGraph
All Implemented Interfaces:
UndirectedLongGraph, UndirectedMutableLongGraph

Deprecated. see package de.aitools.aq.structure.graph

public final class ConcreteUndirectedLongGraph
extends java.lang.Object
implements UndirectedMutableLongGraph

A general implementation for long vertices. Each weight is stored only once in the graph.

Version:
$Id: ConcreteUndirectedLongGraph.java,v 1.2 2011/09/29 12:43:04 dogu3912 Exp $
Author:
johannes.kiesel(/\t)uni-weimar.de

Nested Class Summary
 
Nested classes/interfaces inherited from interface de.aitools.aq.graph.weighted.UndirectedMutableLongGraph
UndirectedMutableLongGraph.Edge
 
Field Summary
 
Fields inherited from interface de.aitools.aq.graph.weighted.UndirectedLongGraph
DEFAULT_UNCONNECTED_WEIGHT
 
Constructor Summary
ConcreteUndirectedLongGraph()
          Deprecated. Create a new ConcreteUndirectedLongGraph with default weight for unconnected vertices and default capacity.
ConcreteUndirectedLongGraph(double unconnectedWeight, int initialCapacity)
          Deprecated. Create a new ConcreteUndirectedLongGraph.
ConcreteUndirectedLongGraph(int initialCapacity)
          Deprecated. Create a new ConcreteUndirectedLongGraph with default weight for unconnected vertices.
 
Method Summary
 boolean addVertex(long vertex)
          Deprecated. Add a vertex to the graph.
 boolean containsEdge(long vertexA, long vertexB)
          Deprecated. Check if there exists an edge in the graph connecting the two vertices given as parameters.
 boolean containsVertex(long vertex)
          Deprecated. Check if given vertex is contained in the graph.
 java.util.Iterator<? extends UndirectedMutableLongGraph.Edge> edges()
          Deprecated. Get an iterator over all edges of the graph.
 java.util.Iterator<? extends UndirectedMutableLongGraph.Edge> edgesConnectedTo(long vertex)
          Deprecated. Get an iterator over all edges in the graph, given vertex is connected with.
 UndirectedMutableLongGraph.Edge getEdge(long vertexA, long vertexB)
          Deprecated. Get the UndirectedLongGraph.Edge connecting the two vertices.
 double getEdgeWeight(long vertexA, long vertexB)
          Deprecated. Get the weight of the edge connecting the two vertices.
 double getUnconnectedWeight()
          Deprecated. The method UndirectedLongGraph.getEdgeWeight(long, long) returns a double value for any possible edge connecting two vertices in the graph.
 int numEdges()
          Deprecated. Get the number of edges.
 int numEdges(long vertex)
          Deprecated.  
 int numVertices()
          Deprecated. Get the number of vertices.
 double removeEdge(long vertexA, long vertexB)
          Deprecated. Remove a edge determined by two vertices.
 boolean removeVertex(long vertex)
          Deprecated. Remove a vertex from the graph.
 double setEdgeWeight(long vertexA, long vertexB, double weight)
          Deprecated. Set the weight of a edge determined by two vertices.
 void setUnconnectedWeight(double unconnectedWeight)
          Deprecated. Change the weight that is returned by UndirectedLongGraph.getEdgeWeight(long, long) if the two vertices are not connected.
 long[] vertices()
          Deprecated. Get an array containing all current vertices of this graph.
 long[] verticesConnectedTo(long vertex)
          Deprecated. Get an array containing all vertices that are connected with given vertex at the moment of this call.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcreteUndirectedLongGraph

public ConcreteUndirectedLongGraph()
Deprecated. 
Create a new ConcreteUndirectedLongGraph with default weight for unconnected vertices and default capacity.

See Also:
setUnconnectedWeight(double), ConcreteUndirectedLongGraph(double, int)

ConcreteUndirectedLongGraph

public ConcreteUndirectedLongGraph(int initialCapacity)
Deprecated. 
Create a new ConcreteUndirectedLongGraph with default weight for unconnected vertices.

Parameters:
initialCapacity - The initial capacity of vertices (grows automatically) or a negative value to use a default value.
See Also:
setUnconnectedWeight(double), ConcreteUndirectedLongGraph(double, int)

ConcreteUndirectedLongGraph

public ConcreteUndirectedLongGraph(double unconnectedWeight,
                                   int initialCapacity)
Deprecated. 
Create a new ConcreteUndirectedLongGraph.

Parameters:
unconnectedWeight - The weight for unconnected vertices. Default is UndirectedGraph#DEFAULT_UNCONNECTED_WEIGHT.
initialCapacity - The initial capacity of vertices (grows automatically) or a negative value to use a default value.
Method Detail

getUnconnectedWeight

public double getUnconnectedWeight()
Deprecated. 
Description copied from interface: UndirectedLongGraph
The method UndirectedLongGraph.getEdgeWeight(long, long) returns a double value for any possible edge connecting two vertices in the graph. If an edge does not exist, the method will return this value.

Specified by:
getUnconnectedWeight in interface UndirectedLongGraph
Returns:
A weight for not existing edges.

setUnconnectedWeight

public void setUnconnectedWeight(double unconnectedWeight)
Deprecated. 
Description copied from interface: UndirectedMutableLongGraph
Change the weight that is returned by UndirectedLongGraph.getEdgeWeight(long, long) if the two vertices are not connected. This will remove all edges that currently have unconnectedWeight as their weight.

Specified by:
setUnconnectedWeight in interface UndirectedMutableLongGraph
Parameters:
unconnectedWeight - The new weight for unconnected vertices.

numVertices

public int numVertices()
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get the number of vertices.

Specified by:
numVertices in interface UndirectedLongGraph
Returns:
The number of vertices in the graph.

numEdges

public int numEdges()
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get the number of edges.

Specified by:
numEdges in interface UndirectedLongGraph
Returns:
The number of edges in the graph.

numEdges

public int numEdges(long vertex)
Deprecated. 
Specified by:
numEdges in interface UndirectedLongGraph
Parameters:
vertex - Which vertex to count edges of.
Returns:
The number of edges this vertex is connected with.

vertices

public long[] vertices()
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get an array containing all current vertices of this graph.

Specified by:
vertices in interface UndirectedLongGraph
Returns:
The array.
See Also:
UndirectedLongGraph.numVertices()

verticesConnectedTo

public long[] verticesConnectedTo(long vertex)
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get an array containing all vertices that are connected with given vertex at the moment of this call.

Specified by:
verticesConnectedTo in interface UndirectedLongGraph
Parameters:
vertex - The vertex.
Returns:
The array.
See Also:
UndirectedLongGraph.numEdges(long)

edges

public java.util.Iterator<? extends UndirectedMutableLongGraph.Edge> edges()
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get an iterator over all edges of the graph. Each edge is only visited once.

Specified by:
edges in interface UndirectedLongGraph
Specified by:
edges in interface UndirectedMutableLongGraph
Returns:
The iterator.
See Also:
UndirectedLongGraph.numEdges()

edgesConnectedTo

public java.util.Iterator<? extends UndirectedMutableLongGraph.Edge> edgesConnectedTo(long vertex)
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get an iterator over all edges in the graph, given vertex is connected with.

Specified by:
edgesConnectedTo in interface UndirectedLongGraph
Specified by:
edgesConnectedTo in interface UndirectedMutableLongGraph
Parameters:
vertex - The vertex.
Returns:
The iterator.
See Also:
UndirectedLongGraph.numEdges(long)

containsVertex

public boolean containsVertex(long vertex)
Deprecated. 
Description copied from interface: UndirectedLongGraph
Check if given vertex is contained in the graph.

Specified by:
containsVertex in interface UndirectedLongGraph
Parameters:
vertex - The vertex to look for.
Returns:
True if the vertex is contained. False otherwise.

containsEdge

public boolean containsEdge(long vertexA,
                            long vertexB)
Deprecated. 
Description copied from interface: UndirectedLongGraph
Check if there exists an edge in the graph connecting the two vertices given as parameters.

Specified by:
containsEdge in interface UndirectedLongGraph
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
True if both vertices are connected.

getEdgeWeight

public double getEdgeWeight(long vertexA,
                            long vertexB)
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get the weight of the edge connecting the two vertices. This will return UndirectedLongGraph.getUnconnectedWeight() if the two vertices are not connected.

Specified by:
getEdgeWeight in interface UndirectedLongGraph
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
The weight of the edge or UndirectedLongGraph.getUnconnectedWeight().
See Also:
UndirectedLongGraph.containsEdge(long, long), UndirectedLongGraph.getEdge(long, long)

getEdge

public UndirectedMutableLongGraph.Edge getEdge(long vertexA,
                                               long vertexB)
Deprecated. 
Description copied from interface: UndirectedLongGraph
Get the UndirectedLongGraph.Edge connecting the two vertices. The object will also be returned if there does not exists such an edge in the graph. Use UndirectedLongGraph.Edge.exists() to check.

Specified by:
getEdge in interface UndirectedLongGraph
Specified by:
getEdge in interface UndirectedMutableLongGraph
Parameters:
vertexA - One vertex.
vertexB - The other vertex.
Returns:
The edge.
See Also:
UndirectedLongGraph.containsEdge(long, long), UndirectedLongGraph.getEdgeWeight(long, long)

addVertex

public boolean addVertex(long vertex)
Deprecated. 
Description copied from interface: UndirectedMutableLongGraph
Add a vertex to the graph.

Specified by:
addVertex in interface UndirectedMutableLongGraph
Parameters:
vertex - The vertex to be added.
Returns:
True if the graph changed during this call. False if the graph already contained that vertex.

removeVertex

public boolean removeVertex(long vertex)
Deprecated. 
Description copied from interface: UndirectedMutableLongGraph
Remove a vertex from the graph.

Specified by:
removeVertex in interface UndirectedMutableLongGraph
Parameters:
vertex - The vertex to be removed.
Returns:
True if the graph changed during this call. False if the graph has not contained that vertex.

setEdgeWeight

public double setEdgeWeight(long vertexA,
                            long vertexB,
                            double weight)
Deprecated. 
Description copied from interface: UndirectedMutableLongGraph
Set the weight of a edge determined by two vertices. If the new weight is UndirectedLongGraph.getUnconnectedWeight(), this should be the same as calling UndirectedMutableLongGraph.removeEdge(long, long). The old weight of the edge is returned, which may be UndirectedLongGraph.getUnconnectedWeight() if the edge had not existed.

Specified by:
setEdgeWeight in interface UndirectedMutableLongGraph
Parameters:
vertexA - One vertex of the edge.
vertexB - The other vertex of the edge.
weight - The new weight of the edge.
Returns:
The value that would have been returned by a call to UndirectedLongGraph.getEdgeWeight(long, long) directly before this call.

removeEdge

public double removeEdge(long vertexA,
                         long vertexB)
Deprecated. 
Description copied from interface: UndirectedMutableLongGraph
Remove a edge determined by two vertices. The old weight of the edge is returned, which may be UndirectedLongGraph.getUnconnectedWeight() if the edge had not existed (in which case nothing has happened).

Specified by:
removeEdge in interface UndirectedMutableLongGraph
Parameters:
vertexA - One vertex of the edge.
vertexB - The other vertex of the edge.
Returns:
The value that would have been returned by a call to UndirectedLongGraph.getEdgeWeight(long, long) directly before this call.