|
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.bridge.SequenceValueCollection<E,C> dk.rode.thesis.bridge.SequenceValueSet<E,HashSet<E>> dk.rode.thesis.bridge.SequenceValueHashSet<E>
E
- The type of serializable values stored in this value set.@Participant(value="ConcreteImplementor") public class SequenceValueHashSet<E extends Serializable>
A sequence value hash set stores sequence values
in a java.util.HashSet
instance.
A sequence value hash set is always unordered
,
unsorted
, but contains no duplicates
.
Field Summary |
---|
Fields inherited from class dk.rode.thesis.bridge.SequenceValueCollection |
---|
number, type, values |
Constructor Summary | |
---|---|
|
SequenceValueHashSet(Class<E> type,
HashSet<E> values)
Constructor, which creates this sequence value hash set to use the java.util.HashSet instance
supplied as values . |
private |
SequenceValueHashSet(Class<E> type,
HashSet<E> values,
int number)
Constructor, which creates this sequence value hash set to use the java.util.HashSet instance
supplied as values . |
Method Summary | |
---|---|
SequenceValueHashSet<E> |
copy()
Performs a deep copy of this generator. |
boolean |
ordered()
Returns false. |
boolean |
sorted()
Returns false. |
Methods inherited from class dk.rode.thesis.bridge.SequenceValueSet |
---|
duplicates, first, get, get, numberOf |
Methods inherited from class dk.rode.thesis.bridge.SequenceValueCollection |
---|
checkNumber, equals, getStringablePolicy, getValueType, hashCode, number, size, toCollection, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SequenceValueHashSet(Class<E> type, HashSet<E> values)
java.util.HashSet
instance
supplied as values
.
Modifying values
externally will affect this
value set and should not be performed. The result
of doing so is undefined - but never good.
type
- The type of values stored in this value set (and
values
); cannot be null.values
- The actual HashSet
instance storing
the sequence values; cannot be null, empty, or
contain null values.
NullPointerException
- If either argument is null.
IllegalArgumentException
- If values
is empty,
contain a null value.private SequenceValueHashSet(Class<E> type, HashSet<E> values, int number)
java.util.HashSet
instance
supplied as values
.
Modifying values
externally will affect this
value set and should not be performed. The result
of doing so is undefined - but never good.
type
- The type of values stored in this value set (and
values
); cannot be null.values
- The actual HashSet
instance storing
the sequence values; cannot be null, empty, or
contain null values.number
- The number pointing the the number
'th value
to be returned by the next call to SequenceValueSet.get()
.
NullPointerException
- If either argument is null.
IllegalArgumentException
- If values
is empty,
contain a null value, or if number
is illegal.Method Detail |
---|
public SequenceValueHashSet<E> copy()
SequenceValueCollection
The size
, ordered
,
sorted
, and duplicate
properties are adhered to by the returned clone.
The work in copying this collection is proportional with the number of values contained, and is thus more expensive the larger this collection is!
copy
in interface SequenceValueGenerator<E extends Serializable>
copy
in interface Copyable<SequenceValueGenerator<E extends Serializable>>
copy
in class SequenceValueCollection<E extends Serializable,HashSet<E extends Serializable>>
public boolean ordered()
public boolean sorted()
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |