diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-03-03 15:47:59 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-03-03 15:47:59 +0000 |
commit | 68a15c23a2d76350e49451150a990d9141a4a526 (patch) | |
tree | ff455ad4f7cc9471c8d43266b6be865d838bf6df /src | |
parent | a3ed64875b5c587db63ae5e9a84095a4eaab5d60 (diff) |
added SeqEnumeration
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/SeqEnumeration.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/jvm/clojure/lang/SeqEnumeration.java b/src/jvm/clojure/lang/SeqEnumeration.java new file mode 100644 index 00000000..384a50c6 --- /dev/null +++ b/src/jvm/clojure/lang/SeqEnumeration.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Rich Hickey. All rights reserved. + * The use and distribution terms for this software are covered by the + * Common Public License 1.0 (http://opensource.org/licenses/cpl.php) + * which can be found in the file CPL.TXT at the root of this distribution. + * By using this software in any fashion, you are agreeing to be bound by + * the terms of this license. + * You must not remove this notice, or any other, from this software. + **/ + +/* rich Mar 3, 2008 */ + +package clojure.lang; + +import java.util.Enumeration; + +public class SeqEnumeration implements Enumeration{ +ISeq seq; + +public SeqEnumeration(ISeq seq){ + this.seq = seq; +} + +public boolean hasMoreElements(){ + return seq != null; +} + +public Object nextElement(){ + Object ret = RT.first(seq); + seq = RT.rest(seq); + return ret; +} +} |