| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | package net.sf.saxon.expr.sort; |
| 9 | |
| 10 | import net.sf.saxon.z.IntIterator; |
| 11 | |
| 12 | /** |
| 13 | * An iterator over a zero-length sequence of integers |
| 14 | */ |
| 15 | public class EmptyIntIterator implements IntIterator { |
| 16 | |
| 17 | private static EmptyIntIterator THE_INSTANCE = new EmptyIntIterator(); |
| 18 | |
| 19 | /** |
| 20 | * Get the singular instance of this class |
| 21 | * |
| 22 | * @return the singular instance |
| 23 | */ |
| 24 | |
| 25 | /*@NotNull*/ |
| 26 | public static EmptyIntIterator getInstance() { |
| 27 | return THE_INSTANCE; |
| 28 | } |
| 29 | |
| 30 | private EmptyIntIterator() { |
| 31 | } |
| 32 | |
| 33 | |
| 34 | /** |
| 35 | * Test whether there are any more integers in the sequence |
| 36 | * |
| 37 | * @return true if there are more integers to come |
| 38 | */ |
| 39 | |
| 40 | public boolean hasNext() { |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Return the next integer in the sequence. The result is undefined unless hasNext() has been called |
| 46 | * and has returned true. |
| 47 | * |
| 48 | * @return the next integer in the sequence |
| 49 | */ |
| 50 | |
| 51 | public int next() { |
| 52 | return 0; |
| 53 | } |
| 54 | } |
| 55 |