blob: e29f4a042f0559169ab8e04cbd9752c93ff6245d (
plain) (
blame)
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
43
44
45
46
47
48
49
50
|
/*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Rational Software - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser;
import java.util.Iterator;
import java.util.NoSuchElementException;
public final class EmptyIterator<T> implements Iterator<T>
{
public static final EmptyIterator<?> EMPTY_ITERATOR = new EmptyIterator<Object>();
private EmptyIterator()
{
}
/* (non-Javadoc)
* @see java.util.Iterator#hasNext()
*/
public final boolean hasNext()
{
return false;
}
/* (non-Javadoc)
* @see java.util.Iterator#next()
*/
public final T next()
{
throw new NoSuchElementException();
}
/* (non-Javadoc)
* @see java.util.Iterator#remove()
*/
public final void remove()
{
throw new UnsupportedOperationException();
}
}
|