LexoRank class
LexoRank 算法实现 用于生成可排序的字符串,支持在任意两个元素之间插入新元素
Constructors
- LexoRank()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
between(
String? prevRank, String? nextRank) → String - 在两个 rank 之间生成一个新的 rank
-
compare(
String rank1, String rank2) → int - 比较两个 rank 的大小
-
generateInitialRank(
) → String - 生成初始的第一个 rank
-
generateInitialRanks(
int count) → List< String> - 批量生成初始 ranks
-
insertFirst(
String? firstRank) → String - 在列表开头插入新的 rank
-
insertLast(
String? lastRank) → String - 在列表末尾插入新的 rank
-
isValidRank(
String rank) → bool - 验证 rank 字符串是否有效
-
rebalance(
int count) → List< String> - 重新平衡一组 ranks(当 ranks 变得太长时使用)