public void addVertex(Object id) throws IllegalArgumentException {
  if (initialized) {
    throw new IllegalArgumentException();
  }
  Vertex vertex=new Vertex(id);
  Object existing=vertexMap.put(id,vertex);
  if (existing != null) {
    throw new IllegalArgumentException();
  }
  vertexList.add(vertex);
}

public void addVertex ( Object id ) throws IllegalArgumentException { if ( initialized ) { throw new IllegalArgumentException ( ) ; } Vertex vertex = new Vertex ( id ) ; Object existing = vertexMap . put ( id , vertex ) ; if ( existing != null ) { throw new IllegalArgumentException ( ) ; } vertexList . add ( vertex ) ; }
defines a new vertex with the given id . the depth - first search is performed in the relative order in which vertexes were added to the graph .
