Package org.jgrapht.alg.shortestpath
Class NegativeCycleDetectedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.jgrapht.alg.shortestpath.NegativeCycleDetectedException
-
- All Implemented Interfaces:
java.io.Serializable
public class NegativeCycleDetectedException extends java.lang.RuntimeExceptionAn exception used to notify about the detection of a negative cycle. The exception may carry the negative cycle to the user.- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NegativeCycleDetectedException()Constructs a new exception withnullas its detail message.NegativeCycleDetectedException(java.lang.String message)Constructs a new exception with the specified detail message.NegativeCycleDetectedException(java.lang.String message, GraphPath<?,?> cycle)Constructs a new exception with the specified detail message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphPath<?,?>getCycle()Get the actual negative cycle, or null if not provided.voidsetCycle(GraphPath<?,?> cycle)Set the negative cycle.
-
-
-
Constructor Detail
-
NegativeCycleDetectedException
public NegativeCycleDetectedException()
Constructs a new exception withnullas its detail message. The cause is not initialized, and may subsequently be initialized by a call toThrowable.initCause(java.lang.Throwable).
-
NegativeCycleDetectedException
public NegativeCycleDetectedException(java.lang.String message)
Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call toThrowable.initCause(java.lang.Throwable).- Parameters:
message- the detail message. The detail message is saved for later retrieval by theThrowable.getMessage()method.
-
NegativeCycleDetectedException
public NegativeCycleDetectedException(java.lang.String message, GraphPath<?,?> cycle)Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call toThrowable.initCause(java.lang.Throwable).- Parameters:
message- the detail message. The detail message is saved for later retrieval by theThrowable.getMessage()method.cycle- the negative weight cycle
-
-