// Copyright 2003, Trustees of Indiana University // Please see the license in the file ../LICENSE // Simple edge class public class adj_list_edge implements GraphEdge { private Vertex source_, target_; public adj_list_edge(Vertex s, Vertex t) { source_ = s; target_ = t; } public Vertex source() {return source_;} public Vertex target() {return target_;} public java.lang.String toString() { return "edge(" + source_ + " -> " + target_ + ")"; } public int hashCode() { return source_.hashCode() + target_.hashCode(); } public boolean equals(java.lang.Object o) { adj_list_edge oo = (adj_list_edge)(o); if (oo == null) return false; return (source_.equals(oo.source()) && target_.equals(oo.target())); } }