Enum Class GraphErrorCode
- All Implemented Interfaces:
Serializable, Comparable<GraphErrorCode>, Constable
Graph Error Code
图错误码
Error codes for graph operations.
图操作的错误码。
Features | 主要功能:
- Categorized error codes (1xxx structure, 2xxx algorithm, 3xxx validation, 4xxx resource) - 分类错误码
- Numeric code and description for each error - 每个错误的数字代码和描述
Usage Examples | 使用示例:
GraphErrorCode code = GraphErrorCode.CYCLE_DETECTED;
int numericCode = code.getCode(); // 2001
String desc = code.getDescription(); // "Cycle detected"
Security | 安全性:
- Thread-safe: Yes (immutable enum) - 线程安全: 是(不可变枚举)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-graph V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCycle detected | 检测到环Graph is disconnected | 图不连通Duplicate edge | 重复边Duplicate vertex | 重复顶点Edge not found | 边不存在Invalid graph direction | 无效的图方向Invalid edge | 无效边Invalid vertex | 无效顶点Invalid weight | 无效权重Limit exceeded | 超出限制Negative weight cycle detected | 检测到负权环Negative weight edge | 负权边No path exists | 无路径Graph is not bipartite | 图不是二部图Graph is not a DAG | 图不是有向无环图Out of memory | 内存不足Timeout | 计算超时Unknown error | 未知错误Vertex not found | 顶点不存在 -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Get the error code 获取错误码Get the error description 获取错误描述static GraphErrorCodeReturns the enum constant of this class with the specified name.static GraphErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Unknown error | 未知错误 -
VERTEX_NOT_FOUND
Vertex not found | 顶点不存在 -
EDGE_NOT_FOUND
Edge not found | 边不存在 -
DUPLICATE_VERTEX
Duplicate vertex | 重复顶点 -
DUPLICATE_EDGE
Duplicate edge | 重复边 -
CYCLE_DETECTED
Cycle detected | 检测到环 -
NO_PATH
No path exists | 无路径 -
DISCONNECTED
Graph is disconnected | 图不连通 -
NEGATIVE_WEIGHT
Negative weight edge | 负权边 -
INVALID_DIRECTION
Invalid graph direction | 无效的图方向 -
NEGATIVE_CYCLE
Negative weight cycle detected | 检测到负权环 -
NOT_DAG
Graph is not a DAG | 图不是有向无环图 -
NOT_BIPARTITE
Graph is not bipartite | 图不是二部图 -
INVALID_VERTEX
Invalid vertex | 无效顶点 -
INVALID_EDGE
Invalid edge | 无效边 -
INVALID_WEIGHT
Invalid weight | 无效权重 -
LIMIT_EXCEEDED
Limit exceeded | 超出限制 -
TIMEOUT
Timeout | 计算超时 -
OUT_OF_MEMORY
Out of memory | 内存不足
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()Get the error code 获取错误码- Returns:
- error code | 错误码
-
getDescription
-