package me.teaisaweso.shared;

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

    /**
     * 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);
    }

}

@@ -168,16 +168,24 @@
 an edge%0A
+     * %0A
      * @
@@ -192,16 +192,34 @@
 param v1
+%0A     *           
  the %22fr
@@ -245,16 +245,34 @@
 param v2
+%0A     *           
  the %22to
@@ -297,16 +297,34 @@
 aram dir
+%0A     *           
  the edg
@@ -468,37 +468,33 @@
 ir = dir;%0A    %7D%0A
-    
 %0A
+
     /**%0A     * d
@@ -522,32 +522,40 @@
  exits a vertex%0A
+     * %0A
      * @param v 
@@ -545,32 +545,50 @@
 %0A     * @param v
+%0A     *           
  the vertex to t
@@ -804,33 +804,32 @@
 else return v ==
- 
  ((mDir == Verte
@@ -881,13 +881,9 @@
   %7D%0A
-    
 %0A
+
     
@@ -924,32 +924,40 @@
 enters a vertex%0A
+     * %0A
      * @param v 
@@ -955,16 +955,34 @@
 @param v
+%0A     *           
  the ver
@@ -1184,32 +1184,32 @@
 )) return true;%0A
+
         else ret
@@ -1216,17 +1216,16 @@
 urn v ==
- 
  ((mDir 

reformat the edge class to look nicer