|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CharListIterator
A bi-directional iterator over char
values.
CharListIteratorListIterator
,
ListIteratorCharListIterator
Method Summary | |
---|---|
void |
add(char element)
Inserts the specified element into my underlying collection (optional operation). |
boolean |
hasNext()
Returns true iff I have more elements
when traversed in the forward direction. |
boolean |
hasPrevious()
Returns true iff I have more elements
when traversed in the reverse direction. |
char |
next()
Returns the next element in me when traversed in the forward direction. |
int |
nextIndex()
Returns the index of the element that would be returned by a subsequent call to next() , or the number
of elements in my iteration if I have no next element. |
char |
previous()
Returns the next element in me when traversed in the reverse direction. |
int |
previousIndex()
Returns the index of the element that would be returned by a subsequent call to previous() , or
-1 if I have no previous element. |
void |
remove()
Removes from my underlying collection the last element returned by next() or previous()
(optional operation). |
void |
set(char element)
Replaces in my underlying collection the last element returned by next() or previous()
with the specified value (optional operation). |
Method Detail |
---|
void add(char element)
next()
, if any,
and immediately after the next element that would have been
returned by previous()
, if any.
The new element is inserted immediately before the implied
cursor. A subsequent call to previous()
will return
the added element, a subsequent call to next()
will
be unaffected. This call increases by one the value that
would be returned by a call to nextIndex()
or
previousIndex()
.
element
- the value to be inserted
java.lang.UnsupportedOperationException
- when this operation is not
supported
java.lang.IllegalArgumentException
- if some aspect of the specified element
prevents it from being addedboolean hasNext()
true
iff I have more elements
when traversed in the forward direction.
(In other words, returns true
iff
a call to next()
will return an element
rather than throwing an exception.
hasNext
in interface CharIterator
true
iff I have more elements when
traversed in the forward directionboolean hasPrevious()
true
iff I have more elements
when traversed in the reverse direction.
(In other words, returns true
iff
a call to previous()
will return an element
rather than throwing an exception.
true
iff I have more elements when
traversed in the reverse directionchar next()
next
in interface CharIterator
NoSuchElementException
- if there is no next elementint nextIndex()
next()
, or the number
of elements in my iteration if I have no next element.
char previous()
NoSuchElementException
- if there is no previous elementint previousIndex()
previous()
, or
-1
if I have no previous element.
void remove()
next()
or previous()
(optional operation).
remove
in interface CharIterator
java.lang.UnsupportedOperationException
- if this operation is not
supported
java.lang.IllegalStateException
- if neither next()
nor
previous()
has yet been called, or
remove()
or add(char)
has already been called since
the last call to next()
or previous()
.void set(char element)
next()
or previous()
with the specified value (optional operation).
element
- the value to replace the last returned element with
java.lang.UnsupportedOperationException
- if this operation is not
supported
java.lang.IllegalStateException
- if neither next()
nor
previous()
has yet been called, or
remove()
or add(char)
has already been called since
the last call to next()
or previous()
.
java.lang.IllegalArgumentException
- if some aspect of the specified element
prevents it from being added
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |