Constructor and Description |
---|
ForIterator() |
ForIterator(Object object) |
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
foreach 计数器,从 1 开始
|
int |
getSize()
获取循环总数.
|
boolean |
hasNext() |
boolean |
isEven()
是否第偶数个元素.
|
boolean |
isFirst()
是否第一个元素.
|
boolean |
isLast()
是否最后一个元素.
|
boolean |
isOdd()
是否第奇数个元素.
|
Object |
next() |
void |
remove() |
void |
setIndex(int index) |
void |
setSize(int size) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public ForIterator()
public ForIterator(Object object)
public int getIndex()
ForStatus
public void setIndex(int index)
public int getSize()
ForStatus
如果对 Iterator 进行循环,或者对非 Collection 的 Iterable 进行循环,则返回 -1。
public void setSize(int size)
public boolean isFirst()
ForStatus
public boolean isLast()
ForStatus
public boolean isOdd()
ForStatus
Copyright © 2006–2018 TinyGroup. All rights reserved.