Opus5
Class AbstractGraph.GraphVertex

java.lang.Object
  |
  +--Opus5.AbstractObject
        |
        +--Opus5.AbstractGraph.GraphVertex
All Implemented Interfaces:
Comparable, Vertex
Enclosing class:
AbstractGraph

protected final class AbstractGraph.GraphVertex
extends AbstractObject
implements Vertex

Represents a vertex in this graph.

Version:
$Id: AbstractGraph.java,v 3.5 1998/07/28 12:58:55 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.
See Also:
Vertex

Field Summary
protected  int number
          The number of this vertex.
protected  java.lang.Object weight
          The weight associated with this vertex.
 
Fields inherited from interface Opus5.Vertex
copyright
 
Constructor Summary
AbstractGraph.GraphVertex(int number, java.lang.Object weight)
          Constructs a GraphVertex with the specified number and weight.
 
Method Summary
protected  int compareTo(Comparable object)
          Compares this vertex with a specified comparable object.
 Enumeration getEmanatingEdges()
          Returns an enumeration that enumerates the edges in this graph that emanate from this vertex.
 Enumeration getIncidentEdges()
          Returns an enumeration that enumerates the edges in this graph that are incident upon this vertex.
 int getNumber()
          Returns the number of this vertex.
 Enumeration getPredecessors()
          Returns an enumeration that enumerates the vertices in this graph which are predecessors of this vertex.
 Enumeration getSuccessors()
          Returns an enumeration that enumerates the vertices in this graph which are successors of this vertex.
 java.lang.Object getWeight()
          Returns the weight associated with this vertex.
 int hashCode()
          Returns a hashcode for this vertex.
 java.lang.String toString()
          Returns a string representation of this vertex.
 
Methods inherited from class Opus5.AbstractObject
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Opus5.Comparable
compare, isEQ, isGE, isGT, isLE, isLT, isNE
 

Field Detail

number

protected int number
The number of this vertex.

weight

protected java.lang.Object weight
The weight associated with this vertex.
Constructor Detail

AbstractGraph.GraphVertex

public AbstractGraph.GraphVertex(int number,
                                 java.lang.Object weight)
Constructs a GraphVertex with the specified number and weight.
Parameters:
number - The specified number.
weight - The specified weight.
Method Detail

getNumber

public int getNumber()
Returns the number of this vertex.
Specified by:
getNumber in interface Vertex
Returns:
The number of this vertex.

getWeight

public java.lang.Object getWeight()
Returns the weight associated with this vertex.
Specified by:
getWeight in interface Vertex
Returns:
The weight associated with this vertex.

compareTo

protected int compareTo(Comparable object)
Compares this vertex with a specified comparable object. This method is not implemented yet.
Overrides:
compareTo in class AbstractObject
Throws:
MethodNotImplemented - Always.

hashCode

public int hashCode()
Returns a hashcode for this vertex.
Overrides:
hashCode in class java.lang.Object
Returns:
A hashcode for this vertex.

toString

public java.lang.String toString()
Returns a string representation of this vertex.
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this vertex.

getIncidentEdges

public Enumeration getIncidentEdges()
Returns an enumeration that enumerates the edges in this graph that are incident upon this vertex. The implementation invokes the abstract getIncidentEdges method as follows:
 return AbstractGraph.this.getIncidentEdges (number);
 
Specified by:
getIncidentEdges in interface Vertex
Following copied from interface: Opus5.Vertex
Returns:
An enumeration that enumeartes the edges incident on this vertex.
See Also:
Enumeration

getEmanatingEdges

public Enumeration getEmanatingEdges()
Returns an enumeration that enumerates the edges in this graph that emanate from this vertex. The implementation invokes the abstract getEmanatingEdges method as follows:
 return AbstractGraph.this.getEmanatingEdges (number);
 
Specified by:
getEmanatingEdges in interface Vertex
Following copied from interface: Opus5.Vertex
Returns:
An enumeration that enumerates the edges emanating from this vertex.
See Also:
Enumeration

getPredecessors

public Enumeration getPredecessors()
Returns an enumeration that enumerates the vertices in this graph which are predecessors of this vertex. Implemented using a wrapper around the enumeration returned from the getIncidentEdges method.
Specified by:
getPredecessors in interface Vertex
Returns:
An enumeration of the predecessors of this vertex.

getSuccessors

public Enumeration getSuccessors()
Returns an enumeration that enumerates the vertices in this graph which are successors of this vertex. Implemented using a wrapper around the enumeration returned from the getEmanatingEdges method.
Specified by:
getSuccessors in interface Vertex
Returns:
An enumeration of the successors of this vertex.