-
Notifications
You must be signed in to change notification settings - Fork 0
/
Iterable.java
42 lines (35 loc) · 1.09 KB
/
Iterable.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// --== CS400 Project One File Header ==--
// Name: Riya Kore
// CSL Username: kore
// Email: rykore@wisc.edu
// Lecture #: 003 @2:25pm
// Notes to grader: None
import java.util.Iterator;
import java.util.Spliterator;
/**
* Implementing this interface allows an object to be the target of the enhanced for statement
* (sometimes called the "for-each loop" statement).
*
* @author Riya Kore
*/
public interface Iterable<ValueType> extends java.lang.Iterable {
/**
* Performs the given action for each element of the Iterable until all elements have been
* processed or the action throws an exception.
*
* @param action
*/
public void forEach(ValueType action);
/**
* Creates a Spliterator over the elements described by this Iterable.
*
* @return Spliterator over the elements described by this Iterable.
*/
public Spliterator<ValueType> spliterator();
/**
* Returns an iterator over elements of type ValueType.
*
* @return Iterator<ValueType> - an iterator of ValueType.
*/
public Iterator<ValueType> iterator();
}