[all packages] [package net.sf.pizzacompiler.util] [class hierarchy] [index]

public abstract class net.sf.pizzacompiler.util.Enumerator<A>

(source file: /home/enno/source/tmp/pizza/main/src/net/sf/pizzacompiler/util/Enumerator.pizza)
java.lang.Object
   |
   +----net.sf.pizzacompiler.util.Enumerator<A>

The pure class interface.
public abstract class Enumerator<A>
  implements Enumeration<A>
an abstract class for implementations of the Enumeration interface


Constuctor Index

O Enumerator()

Methods

O concat(Enumerator<A>)
concat another enumerator, to be called when this one is done
O dropWhile((A) -> boolean)
return enumerator that starts with the first element of this enumerator for which `p' holds,
O filter((A) -> boolean)
return enumerator that yields all element of this enumerator that satisfy predicate `p'.
O forall((A) -> B)
apply function `f' to all elements of this enumerator
O hasMoreElements()
the Enumeration methods
O map((A) -> B)
return enumerator that yields `f' applied to each element of this enumerator
O nextElement()
O reduceLeft(B, (B, A) -> B)
reduce all elements of this enumerator with binary operation `f', starting with `z'
O reduceRight((A, B) -> B, B)
reduce all elements of this enumerator with binary operation `f', starting with `z'
O takeWhile((A) -> boolean)
return elements of this enumerator as long as predicate `p' is true

Constructors

O Enumerator
public Enumerator();

Methods

O hasMoreElements
public abstract boolean hasMoreElements();
the Enumeration methods

O nextElement

public abstract A nextElement();

O concat

public Enumerator<A> concat(Enumerator<A> rest);
concat another enumerator, to be called when this one is done

O map

public <B> Enumerator<B> map((A) -> B f);
return enumerator that yields `f' applied to each element of this enumerator

O takeWhile

public Enumerator<A> takeWhile((A) -> boolean p);
return elements of this enumerator as long as predicate `p' is true

O dropWhile

public Enumerator<A> dropWhile((A) -> boolean p);
return enumerator that starts with the first element of this enumerator for which `p' holds, and then continues with all subsequent elements of this enumerator

O filter

public Enumerator<A> filter((A) -> boolean p);
return enumerator that yields all element of this enumerator that satisfy predicate `p'.

O forall

public <B> void forall((A) -> B f);
apply function `f' to all elements of this enumerator

O reduceLeft

public <B> B reduceLeft(B z,
                        (B, A) -> B f);
reduce all elements of this enumerator with binary operation `f', starting with `z'. Operations are grouped to the left.

O reduceRight

public <B> B reduceRight((A, B) -> B f,
                         B z);
reduce all elements of this enumerator with binary operation `f', starting with `z'. Operations are grouped to the right.


[all packages] [package net.sf.pizzacompiler.util] [class hierarchy] [index]
net.sf.pizzacompiler.util.Enumerator.html