Package randoop
Class SubTypeSet
java.lang.Object
randoop.SubTypeSet
A set of classes. This data structure additionally allows for efficient answers to queries about
can-be-used-as relationships.
-
Field Summary
Modifier and TypeFieldDescriptionMaps a type to all its proper subtypes that are in the set.private boolean
If true, thenmark()
andundoLastStep()
are supported.The members of the set. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a type to this set.private void
addQueryType
(Type type) getMatches
(Type type) Returns all the classes in the set that can-be-used-as the givenc
.void
mark()
Checkpoint the state of the data structure, for use byundoLastStep()
.int
size()
Returns the number of elements of this set.void
Undo changes since the last call tomark()
.
-
Field Details
-
types
The members of the set. -
subTypes
Maps a type to all its proper subtypes that are in the set. If the mapped-to list is empty, then the set contains no subtypes of the given type. -
supportsCheckpoints
private boolean supportsCheckpointsIf true, thenmark()
andundoLastStep()
are supported.
-
-
Constructor Details
-
SubTypeSet
public SubTypeSet(boolean supportsCheckpoints)
-
-
Method Details
-
mark
public void mark()Checkpoint the state of the data structure, for use byundoLastStep()
. -
undoLastStep
public void undoLastStep()Undo changes since the last call tomark()
. -
add
Adds a type to this set.- Parameters:
c
- the type to be added
-
addQueryType
-
getMatches
Returns all the classes in the set that can-be-used-as the givenc
.- Parameters:
type
- the query type- Returns:
- the set of types that can be used in place of the query type
-
size
public int size()Returns the number of elements of this set.- Returns:
- the size of the set
-