Changed the methods of AbstractEdge and AbstractVertex to return objects