Package randoop.sequence
Class MappedSequences<K>
- java.lang.Object
-
- randoop.sequence.MappedSequences<K>
-
- Direct Known Subclasses:
ClassLiterals
,PackageLiterals
public class MappedSequences<K> extends Object
A multimap from keys of type K to sequences. Such a map can be useful to specify sequences that should only be used in specific contexts, for example sequences that should only be used as components when testing a specific class.
-
-
Field Summary
Fields Modifier and Type Field Description private static SimpleList<Sequence>
emptyList
private Map<K,SequenceCollection>
map
-
Constructor Summary
Constructors Constructor Description MappedSequences()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSequence(K key, Sequence seq)
Adds a sequence to the set of sequences associated with the given key.Set<Sequence>
getAllSequences()
Returns all sequences as the union of all of the sequence collections.SimpleList<Sequence>
getSequences(K key, Type desiredType)
Returns the set of sequences (as a list) that are associated with the given key and create values of the desiredType.
-
-
-
Field Detail
-
map
private Map<K,SequenceCollection> map
-
emptyList
private static final SimpleList<Sequence> emptyList
-
-
Method Detail
-
addSequence
public void addSequence(K key, Sequence seq)
Adds a sequence to the set of sequences associated with the given key.- Parameters:
key
- the key valueseq
- the sequence
-
getSequences
public SimpleList<Sequence> getSequences(K key, Type desiredType)
Returns the set of sequences (as a list) that are associated with the given key and create values of the desiredType.- Parameters:
key
- the key valuedesiredType
- the query type- Returns:
- the list of sequences for the key and query type
-
-