Crossfire JXClient, Trunk
|
Static Public Member Functions | |
static< E > Iterator< E > | iterator (final E[] array) |
static void | main (final String[] args) |
Protected Member Functions | |
ArrayIterator () | |
The code sample illustrates the usage of default methods in the JDK 8. Most implementations of Iterator don't provide a useful Iterator#remove() method, however, they still have to implement this method to throw an UnsupportedOperationException. With the default method, the same default behavior in interface Iterator itself can be provided.
Definition at line 43 of file ArrayIterator.java.
|
protected |
Close the constructor because ArrayIterator is part of the utility class.
Definition at line 48 of file ArrayIterator.java.
|
static |
Returns an iterator that goes over the elements in the array.
<E> | type of an array element |
array | source array to iterate over it |
Index of the current position
Returns the next element in the iteration
NoSuchElementException | if the iteration has no more elements |
Returns
if the iteration has more elements. (In other words, returns
if next returns an element, rather than throwing an exception.)
This method does not need to be overwritten in JDK 8.
Definition at line 59 of file ArrayIterator.java.
Referenced by main().
|
static |
Sample usage of the ArrayIterator
args | command-line arguments |
Definition at line 110 of file ArrayIterator.java.
References it, and iterator().