org.pcollections
Class AmortizedPQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
org.pcollections.AmortizedPQueue<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, Queue<E>, PCollection<E>, PQueue<E>
public class AmortizedPQueue<E>
- extends AbstractQueue<E>
- implements PQueue<E>
- Author:
- mtklein
Methods inherited from interface org.pcollections.PQueue |
remove |
empty
public static <E> AmortizedPQueue<E> empty()
iterator
public Iterator<E> iterator()
- Specified by:
iterator
in interface Iterable<E>
- Specified by:
iterator
in interface Collection<E>
- Specified by:
iterator
in class AbstractCollection<E>
size
public int size()
- Specified by:
size
in interface Collection<E>
- Specified by:
size
in class AbstractCollection<E>
peek
public E peek()
- Specified by:
peek
in interface Queue<E>
minus
public AmortizedPQueue<E> minus()
- Specified by:
minus
in interface PQueue<E>
plus
public AmortizedPQueue<E> plus(E e)
- Specified by:
plus
in interface PCollection<E>
- Specified by:
plus
in interface PQueue<E>
- Parameters:
e
- non-null
- Returns:
- a collection which contains e and all of the elements of this
plusAll
public AmortizedPQueue<E> plusAll(Collection<? extends E> list)
- Specified by:
plusAll
in interface PCollection<E>
- Specified by:
plusAll
in interface PQueue<E>
- Parameters:
list
- contains no null elements
- Returns:
- a collection which contains all of the elements of list and this
minus
public PCollection<E> minus(Object e)
- Specified by:
minus
in interface PCollection<E>
- Specified by:
minus
in interface PQueue<E>
- Returns:
- this with a single instance of e removed, if e is in this
minusAll
public PCollection<E> minusAll(Collection<?> list)
- Specified by:
minusAll
in interface PCollection<E>
- Specified by:
minusAll
in interface PQueue<E>
- Returns:
- this with all elements of list completely removed
offer
public boolean offer(E o)
- Specified by:
offer
in interface Queue<E>
- Specified by:
offer
in interface PQueue<E>
poll
public E poll()
- Specified by:
poll
in interface Queue<E>
- Specified by:
poll
in interface PQueue<E>
main
public static void main(String[] args)
Copyright © 2011. All Rights Reserved.