KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > om > EmptyEnumeration


1 package com.icl.saxon.om;
2
3 /**
4 * EmptyEnumeration: an enumeration of an empty node-set
5 */

6
7 public class EmptyEnumeration implements AxisEnumeration {
8
9     private static EmptyEnumeration instance = new EmptyEnumeration();
10
11     /**
12     * Return an instance of an EmptyEnumeration
13     */

14
15     public static EmptyEnumeration getInstance() {
16         return instance;
17     }
18     
19     public boolean hasMoreElements() {
20         return false;
21     }
22
23     public NodeInfo nextElement() {
24         return null;
25     }
26
27     public boolean isSorted() {
28         return true;
29     }
30
31     public boolean isReverseSorted() {
32         return true;
33     }
34
35     public boolean isPeer() {
36         return true;
37     }
38
39     public int getLastPosition() {
40         return 0;
41     }
42 }
43
44 //
45
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
46
// you may not use this file except in compliance with the License. You may obtain a copy of the
47
// License at http://www.mozilla.org/MPL/
48
//
49
// Software distributed under the License is distributed on an "AS IS" basis,
50
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
51
// See the License for the specific language governing rights and limitations under the License.
52
//
53
// The Original Code is: all this file.
54
//
55
// The Initial Developer of the Original Code is
56
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
57
//
58
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
59
//
60
// Contributor(s): none.
61
//
62
Popular Tags