From yandong Thu May  2 14:25:32 1996
Received: from sbgrad9.csdept (sbgrad9.cs.sunysb.edu [130.245.2.29]) by cs.sunysb.edu (8.6.12/8.6.9) with SMTP id OAA06629 for <skiena>; Thu, 2 May 1996 14:25:32 -0400
Date: Thu, 2 May 1996 14:25:32 -0400
From: Yan Dong <yandong>
Message-Id: <199605021825.OAA06629@cs.sunysb.edu>
To: skiena
Subject: edge.h
Status: RO


//edge.h

#ifndef EDGE_H
#define EDGE_H
#include <iostream.h>


typedef int Color;

class Edge {

    friend  ostream& operator<<(ostream &output, const Edge &E);

 public:

    static const Edge zero;
    
    Edge(){startVx=0; endVx=0; color=0;}
    Edge(int);
    Edge(int, int);
    Edge(int, int, int);
    const Edge& operator=(const Edge&);

  
    int startVx;
    int endVx;
    Color color;
};
  
//if color = 0, the edge is uncolored.

const Edge Edge::zero = 0;


Edge::Edge(int x)
{
    startVx = x;
    endVx = 0;
    color = 0;
}

Edge::Edge(int x, int y)
{
    startVx  = x;
    endVx = y;
    color = 0;
}

Edge::Edge(int x, int y, int c)
{
    startVx = x;
    endVx = y;
    color = c;
}

const Edge&
Edge::operator=(const Edge& old) 
{
    if (&old == this) {
    } else {
	startVx = old.startVx;
	endVx = old.endVx;
	color = old.color;
    }
    return *this;
}




ostream& operator<<(ostream &output, const Edge &E)
{
    output << E.startVx << "   "<< E.endVx 
	   << "  "<< E.color<< endl;
    return output;

}


#endif




