|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.rode.thesis.abstractfactory.RangeValueFactory
@ParticipantUsage(value="ConcreteProduct", type=SequenceValueRange.class) @Participant(value="ConcreteFactory") public class RangeValueFactory
A range value factory creates value range
generators.
This factory is thread-safe.
Field Summary | |
---|---|
private Integer[] |
defaultMinMax
The default range for the created generators. |
Constructor Summary | |
---|---|
RangeValueFactory(int minimum)
Constructor, which creates this factory to use the minimum value of minimum for all created
generators. |
|
RangeValueFactory(int minimum,
int maximum)
Constructor, which creates this factory to use the minimum value of minimum for all created
generators. |
Method Summary | |
---|---|
SequenceValueRange |
createGenerator()
Creates a new sequence value generator using the default argument. |
SequenceValueRange |
createGenerator(Integer[] minMax)
Creates a new sequence value generator, where argument is an
argument used in the creation process of the generator. |
Integer[] |
getDefaultArgument()
Returns the default argument to use for generator creation in case no argument is supplied to the GeneratorFactory.createGenerator(Object)
method. |
String |
toString()
Returns the string representation of this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final Integer[] defaultMinMax
Length = 1: minimum range, no upper value.
Length = 2: minimum and maximum.
Never null.
Constructor Detail |
---|
public RangeValueFactory(int minimum)
minimum
for all created
generators.
minimum
- The minimum value.public RangeValueFactory(int minimum, int maximum)
minimum
for all created
generators.
minimum
- The minimum value.maximum
- The maximum value.
IllegalArgumentException
- If minimum
is larger
than maximum
.Method Detail |
---|
public SequenceValueRange createGenerator()
GeneratorFactory
default
argument.
createGenerator
in interface GeneratorFactory<Integer,Integer[]>
GeneratorFactory.createGenerator(Object)
,
GeneratorFactory.getDefaultArgument()
public SequenceValueRange createGenerator(Integer[] minMax)
GeneratorFactory
argument
is an
argument used in the creation process of the generator.
createGenerator
in interface GeneratorFactory<Integer,Integer[]>
minMax
- The range, where a length of one indicates a minimum
only, and a length of two indicates a minimum
and maximum value; can be null, in which case the
default range is used.
IllegalArgumentException
- If minimum
is larger
than maximum
.GeneratorFactory.createGenerator()
public Integer[] getDefaultArgument()
GeneratorFactory
GeneratorFactory.createGenerator(Object)
method.
getDefaultArgument
in interface GeneratorFactory<Integer,Integer[]>
public String toString()
toString
in class Object
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |