org.databene.domain.math
Class PadovanLongGenerator
java.lang.Object
org.databene.benerator.util.AbstractGenerator<E>
org.databene.benerator.util.AbstractNonNullGenerator<E>
org.databene.benerator.primitive.number.AbstractNonNullNumberGenerator<E>
org.databene.benerator.primitive.number.RecurrenceRelationNumberGenerator<java.lang.Long>
org.databene.domain.math.PadovanLongGenerator
- All Implemented Interfaces:
- java.io.Closeable, Generator<java.lang.Long>, NonNullGenerator<java.lang.Long>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
public class PadovanLongGenerator
- extends RecurrenceRelationNumberGenerator<java.lang.Long>
Generates numbers according to the Padovan Sequence.
It is defined recursively by
- P(0) = P(1) = P(2) = 1
- P(n) = P(n-2) + P(n-3)
Created at 03.07.2009 13:22:41
- Since:
- 0.6.0
- Author:
- Volker Bergmann
- See Also:
PadovanSequence
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. |
void |
reset()
See Resettable.reset() |
protected void |
resetMembers()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PadovanLongGenerator
public PadovanLongGenerator(java.lang.Long min,
java.lang.Long max,
boolean unique)
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>
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>
reset
public void reset()
- Description copied from class:
RecurrenceRelationNumberGenerator
- See
Resettable.reset()
- Specified by:
reset
in interface org.databene.commons.Resettable
- Overrides:
reset
in class RecurrenceRelationNumberGenerator<java.lang.Long>
resetMembers
protected void resetMembers()
- Overrides:
resetMembers
in class RecurrenceRelationNumberGenerator<java.lang.Long>
Copyright © 2013. All Rights Reserved.