00001 package cz.vutbr.fit.dudka.SGVis.Data;
00002
00003 import java.net.URL;
00004
00009 public class Relation {
00010 public URL from;
00011 public URL to;
00012 public String edgeType;
00013
00019 public Relation(URL from, URL to, String edgeType) {
00020 this.from = from;
00021 this.to = to;
00022 this.edgeType = edgeType;
00023 }
00027 public String toString() {
00028 return
00029 edgeType + ": " +
00030 "\"" + from.toString() +"\" -> " +
00031 "\"" + to.toString() +"\"";
00032 }
00033 public boolean equals(Object obj) {
00034 Relation rel = (Relation)obj;
00035 return
00036 this.from.equals(rel.from) &&
00037 this.to.equals(rel.to) &&
00038 this.edgeType.equals(rel.edgeType);
00039 }
00040 public int hashCode() {
00041 String all =
00042 from.toString() +
00043 to.toString() +
00044 edgeType;
00045 return all.hashCode();
00046 }
00047 }