net.sf.jga.fn.adaptor
Class OrGenerator
java.lang.Object
net.sf.jga.fn.Functor<R>
net.sf.jga.fn.Generator<java.lang.Boolean>
net.sf.jga.fn.adaptor.OrGenerator
- All Implemented Interfaces:
- java.io.Serializable, Visitable
public class OrGenerator
- extends Generator<java.lang.Boolean>
Generator that performs a shortcircuit or operation using a given pair
of Boolean Generators. When the first generator returns true, the second
is not evaluated.
- See Also:
- Serialized Form
|
Nested Class Summary |
static interface |
OrGenerator.Visitor
Interface for classes that may interpret an OrGenerator predicate. |
|
Constructor Summary |
OrGenerator(Generator<java.lang.Boolean> first,
Generator<java.lang.Boolean> second)
Builds a OrGenerator functor, given the two functors that may be executed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OrGenerator
public OrGenerator(Generator<java.lang.Boolean> first,
Generator<java.lang.Boolean> second)
- Builds a OrGenerator functor, given the two functors that may be executed.
- Throws:
java.lang.IllegalArgumentException - if any of the functors is missing
getFirstFunctor
public Generator<java.lang.Boolean> getFirstFunctor()
getSecondFunctor
public Generator<java.lang.Boolean> getSecondFunctor()
fn
public java.lang.Boolean fn()
- Description copied from class:
Generator
- Generate one instance.
- Specified by:
fn in class Generator<java.lang.Boolean>
accept
public void accept(Visitor v)
- Calls the Visitor's
visit(OrGenerator) method, if it
implements the nested Visitor interface.
- Specified by:
accept in interface Visitable- Overrides:
accept in class Functor<java.lang.Boolean>
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2002-2006 David A. Hall. All Rights Reserved.