public abstract class LoopTyme extends AbstractTyme
| 限定符 | 构造器和说明 |
|---|---|
protected |
LoopTyme(String[] names,
int index)
通过索引初始化
|
protected |
LoopTyme(String[] names,
String name)
通过名称初始化
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getIndex()
索引
|
String |
getName()
名称
|
int |
getSize()
数量
|
protected int |
indexOf(int index)
转换为不超范围的索引
|
protected int |
indexOf(String name)
名称对应的索引
|
protected int |
nextIndex(int n)
推移后的索引
|
int |
stepsTo(int targetIndex)
到目标索引的步数
|
equals, indexOf, toStringprotected String[] names
protected int index
protected LoopTyme(String[] names, int index)
names - 名称列表index - 索引,支持负数,自动轮转public String getName()
public int getIndex()
public int getSize()
protected int indexOf(String name)
name - 名称protected int indexOf(int index)
index - 索引protected int nextIndex(int n)
n - 推移步数public int stepsTo(int targetIndex)
targetIndex - 目标索引Copyright © 2025. All Rights Reserved.