Class InvalidEdgeException

All Implemented Interfaces:
OpenExceptionMeta, Serializable

public class InvalidEdgeException extends GraphException
Invalid Edge Exception 无效边异常

Exception thrown when an edge is invalid (e.g., invalid weight).

当边无效(如无效权重)时抛出的异常。

Features | 主要功能:

  • Signals invalid edge parameters (null vertices, NaN/infinite weight) - 表示无效的边参数(null顶点、NaN/无穷权重)
  • Extends GraphException with GraphErrorCode.INVALID_EDGE - 使用INVALID_EDGE错误码扩展GraphException

Usage Examples | 使用示例:

try {
    GraphValidator.validateEdge(from, to, weight);
} catch (InvalidEdgeException e) {
    // handle invalid edge
}

Security | 安全性:

  • Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
  • Null-safe: Yes - 空值安全: 是
Since:
JDK 25, opencode-base-graph V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • InvalidEdgeException

      public InvalidEdgeException(String message)
      Create invalid edge exception 创建无效边异常
      Parameters:
      message - the error message | 错误消息