org.opentripplanner.routing.vertextype.TemporaryVertex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.routing.vertextype;
import org.opentripplanner.routing.graph.Vertex;
/**
* Marker interface for temporary vertices.
*
* Remember to use the {@link #dispose(Vertex)} to delete the temporary vertex
* from the main graph after use.
*
*/
public interface TemporaryVertex {
boolean isEndVertex();
/**
* This method traverse the subgraph of temporary vertices, and cuts that subgraph off from the
* main graph at each point it encounters a non-temporary vertexes. OTP then holds no
* references to the temporary subgraph and it is garbage collected.
*
* Note! If the {@code vertex} is NOT a TemporaryVertex the method returns. No action taken.
*
*
* @param vertex Vertex part of the temporary part of the graph.
*/
static void dispose(Vertex vertex) {
TemporaryVertexDispose.dispose(vertex);
}
}