Appends id2 to the neighbors of id1.
Increases maxNodeId to be at least id, and extends the node data array if needed to ensure the given id is a valid id.
Ensures the given id has space for newCapacity neighbors by allocating a new neighbor area.
Ensures the given id has space for newCapacity neighbors by allocating a new neighbor area. This method doesn't need to be called by clients, but it can be called to improve performance if the client is going to add many new neighbors to the given node id.
A graph which stores the neighbors of each node in only one direction. As a result of a call to addEdge(u, v), neighbors(u) will contain v, but neighbors(v) won't contain u.
Parameter dataPointerPointer is a pointer to a Long value in allocator.data which this class uses to store the pointer to its data. If initializeNewGraph is true, it ignores the current value at dataPointerPointer and sets it to a new allocation; else it reads the data at dataPointerPointer to open an existing graph.
Currently does not keep track of which nodes exist, but assumes all nodes between 0 and maxNodeId exist.
Supports up to 2**32 nodes by using Integer.toUnsignedLong to interpret negative node ids as positive integers.