clojure.lang
Class PersistentQueue
java.lang.Object
clojure.lang.Obj
clojure.lang.PersistentQueue
- All Implemented Interfaces:
- Counted, IMeta, IObj, IPersistentCollection, IPersistentList, IPersistentStack, Seqable, Sequential, java.io.Serializable, java.lang.Iterable, java.util.Collection
public class PersistentQueue
- extends Obj
- implements IPersistentList, java.util.Collection, Counted
conses onto rear, peeks/pops from front
See Okasaki's Batched Queues
This differs in that it uses a PersistentVector as the rear, which is in-order,
so no reversing or suspensions required for persistent use
- See Also:
- Serialized Form
Methods inherited from class clojure.lang.Obj |
meta |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
EMPTY
public static final PersistentQueue EMPTY
equiv
public boolean equiv(java.lang.Object obj)
- Specified by:
equiv
in interface IPersistentCollection
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interface java.util.Collection
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Specified by:
hashCode
in interface java.util.Collection
- Overrides:
hashCode
in class java.lang.Object
peek
public java.lang.Object peek()
- Specified by:
peek
in interface IPersistentStack
pop
public PersistentQueue pop()
- Specified by:
pop
in interface IPersistentStack
count
public int count()
- Specified by:
count
in interface Counted
- Specified by:
count
in interface IPersistentCollection
seq
public ISeq seq()
- Specified by:
seq
in interface Seqable
cons
public PersistentQueue cons(java.lang.Object o)
- Specified by:
cons
in interface IPersistentCollection
empty
public IPersistentCollection empty()
- Specified by:
empty
in interface IPersistentCollection
withMeta
public PersistentQueue withMeta(IPersistentMap meta)
- Specified by:
withMeta
in interface IObj
- Specified by:
withMeta
in class Obj
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interface java.util.Collection
add
public boolean add(java.lang.Object o)
- Specified by:
add
in interface java.util.Collection
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interface java.util.Collection
addAll
public boolean addAll(java.util.Collection c)
- Specified by:
addAll
in interface java.util.Collection
clear
public void clear()
- Specified by:
clear
in interface java.util.Collection
retainAll
public boolean retainAll(java.util.Collection c)
- Specified by:
retainAll
in interface java.util.Collection
removeAll
public boolean removeAll(java.util.Collection c)
- Specified by:
removeAll
in interface java.util.Collection
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAll
in interface java.util.Collection
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- Specified by:
toArray
in interface java.util.Collection
size
public int size()
- Specified by:
size
in interface java.util.Collection
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Collection
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interface java.util.Collection
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interface java.lang.Iterable
- Specified by:
iterator
in interface java.util.Collection
Copyright © 2012. All Rights Reserved.