1: // @author Frank M. Carrano, Timothy M. Henry 2: // @version 5.0 3: public boolean equals(Object other) 4: { 5: boolean result; 7: if ((other == null) || (getClass() != other.getClass())) 8: result = false; 9: else 10: { 11: // The cast is safe within this else clause 12: @SuppressWarnings("unchecked") 13: Vertex<T> otherVertex = (Vertex<T>)other; 14: result = label.equals(otherVertex.label); 15: } // end if 17: return result; 18: } // end equals