org.databene.domain.math
Class FibonacciLongGenerator

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
      extended by org.databene.benerator.util.AbstractNonNullGenerator<E>
          extended by org.databene.benerator.primitive.number.AbstractNonNullNumberGenerator<E>
              extended by org.databene.benerator.primitive.number.RecurrenceRelationNumberGenerator<java.lang.Long>
                  extended by org.databene.domain.math.FibonacciLongGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.Long>, NonNullGenerator<java.lang.Long>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class FibonacciLongGenerator
extends RecurrenceRelationNumberGenerator<java.lang.Long>

Generates Fibonacci Numbers. It is defined recursively by


Created at 03.07.2009 10:44:56

Since:
0.6.0
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.primitive.number.AbstractNonNullNumberGenerator
generatedType, granularity, max, min
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
FibonacciLongGenerator(java.lang.Long min, java.lang.Long max, boolean unique)
           
 
Method Summary
protected  java.lang.Long a0(int n)
          Must be implemented by child classes to return the seed values of the recurrence relation.
protected  java.lang.Long aN()
          Must be implemented by child classes to implement the recurrence relation.
protected  void resetMembers()
           
 
Methods inherited from class org.databene.benerator.primitive.number.RecurrenceRelationNumberGenerator
aN, calculateNext, close, generate, getDepth, getN, init, reset
 
Methods inherited from class org.databene.benerator.primitive.number.AbstractNonNullNumberGenerator
getGeneratedType, getGranularity, getMax, getMin, isParallelizable, isThreadSafe, setGranularity, setMax, setMin
 
Methods inherited from class org.databene.benerator.util.AbstractNonNullGenerator
generate
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, toString, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.Generator
wasInitialized
 

Constructor Detail

FibonacciLongGenerator

public FibonacciLongGenerator(java.lang.Long min,
                              java.lang.Long max,
                              boolean unique)
Method Detail

aN

protected java.lang.Long aN()
Description copied from class: RecurrenceRelationNumberGenerator
Must be implemented by child classes to implement the recurrence relation. It needs to use the RecurrenceRelationNumberGenerator.aN(int) method to retrieve the most recent calculated values.

Specified by:
aN in class RecurrenceRelationNumberGenerator<java.lang.Long>

a0

protected java.lang.Long a0(int n)
Description copied from class: RecurrenceRelationNumberGenerator
Must be implemented by child classes to return the seed values of the recurrence relation. These are the initial values which are defined as constants (a(0)..a(depth-1)).

Specified by:
a0 in class RecurrenceRelationNumberGenerator<java.lang.Long>

resetMembers

protected void resetMembers()
Overrides:
resetMembers in class RecurrenceRelationNumberGenerator<java.lang.Long>


Copyright © 2013. All Rights Reserved.