|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.callbackparams.combine.AbstractCombineStrategy
public abstract class AbstractCombineStrategy
Abstract stub implementation of CombineStrategy
that is intended to
be a convenient super-class for most implementations.
Field Summary | |
---|---|
protected int |
maxCount
|
Constructor Summary | |
---|---|
AbstractCombineStrategy()
|
Method Summary | |
---|---|
Collection |
combine(ValuesCollection vc)
Implementations of this method will create a collection of callback- records based on the configuration of this CombineStrategy instance. |
protected abstract Collection |
combineInternal(ValuesCollection vc)
This is the method to implement when implementing CombineStrategy by subclassing AbstractCombineStrategy . |
protected long |
getRandomSeed()
Returns the random-seed that has been set by setRandomSeed(long) . |
void |
setMaxCount(int maxCount)
Specifies the maximum number of combinations that the method CombineStrategy.combine(ValuesCollection) is allowed to return. |
void |
setRandomSeed(long randomSeed)
Some CombineStrategy implementations does to some extent pick callback-record parameters randomly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int maxCount
Constructor Detail |
---|
public AbstractCombineStrategy()
Method Detail |
---|
public void setMaxCount(int maxCount)
CombineStrategy
CombineStrategy.combine(ValuesCollection)
is allowed to return. The default
value is implementation dependent.
setMaxCount
in interface CombineStrategy
public void setRandomSeed(long randomSeed)
CombineStrategy
setRandomSeed
in interface CombineStrategy
public Collection combine(ValuesCollection vc)
CombineStrategy
combine
in interface CombineStrategy
protected long getRandomSeed()
setRandomSeed(long)
.
If random-seed has not yet been set it will be set to the current
timestamp.
protected abstract Collection combineInternal(ValuesCollection vc)
CombineStrategy
by subclassing AbstractCombineStrategy
.
The advantage compared to overriding combine(ValuesCollection)
is that maxCount-check and validation of configuration for
setMaxCount(int)
and setRandomSeed(long)
will be taken
care of by the super-class - relieving this method to administer
combining exclusivly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |