loopGetListContent<T> static method
循环获取列表的内容,如果其索引大于列表的长度,则重头开始继续获取
Implementation
static T loopGetListContent<T>(List<T> list, int index) {
if (index <= 0) {
return list[0];
} else if (index < list.length) {
return list[index];
} else {
return loopGetListContent(list, index - list.length);
}
}