package me.teaisaweso.shared;

public class Edge {
    private Vertex mVertex1;
    private Vertex mVertex2;
    private VertexDirection mDir;

    /**
     * creates an edge without direction
     * 
     * @param v1
     *            the "from" vertex
     * @param v2
     *            the "to" vertex
     */
    public Edge(Vertex v1, Vertex v2) {
        this(v1, v2, VertexDirection.both);
    }

    /**
     * creates an edge
     * 
     * @param v1
     *            the "from" vertex
     * @param v2
     *            the "to" vertex
     * @param dir
     *            the edge direction
     */
    public Edge(Vertex v1, Vertex v2, VertexDirection dir) {
        mVertex1 = v1;
        mVertex2 = v2;
        mDir = dir;
    }

    /**
     * determines if the edge exits a vertex
     * 
     * @param v
     *            the vertex to test against
     * @return true if this edge exits v, else false
     */
    public boolean exits(Vertex v) {
        if (mDir == VertexDirection.both && (v == mVertex1 || v == mVertex2)) return true;
        else return v == ((mDir == VertexDirection.fromTo) ? mVertex1 : mVertex2);
    }

    /**
     * determines if the edge enters a vertex
     * 
     * @param v
     *            the vertex to test against
     * @return true if this edge enters v, else false
     */
    public boolean enters(Vertex v) {
        if (mDir == VertexDirection.both && (v == mVertex1 || v == mVertex2)) return true;
        else return v == ((mDir == VertexDirection.toFrom) ? mVertex1 : mVertex2);
    }

}

@@ -999,36 +999,40 @@
 n.both && (v
- == 
+.equals(
 mVertex1
  %7C%7C v == mVe
@@ -1015,33 +1015,38 @@
 als(mVertex1
+)
  %7C%7C v
- == 
+.equals(
 mVertex2)) r
@@ -1035,32 +1035,33 @@
 quals(mVertex2))
+)
  return true;%0A  
@@ -1071,36 +1071,39 @@
    else return v
- == 
+.equals
 ((mDir == Vertex
@@ -1424,20 +1424,24 @@
 & (v
- == 
+.equals(
 mVertex1
  %7C%7C 
@@ -1440,17 +1440,22 @@
 tex1
+)
  %7C%7C v
- == 
+.equals(
 mVer
@@ -1460,16 +1460,17 @@
 ertex2))
+)
  return 
@@ -1496,20 +1496,23 @@
 return v
- == 
+.equals
 ((mDir =

modify the way exits and enters works on edge