Package randoop

Class SubTypeSet

java.lang.Object
randoop.SubTypeSet

public class SubTypeSet extends Object
A set of classes. This data structure additionally allows for efficient answers to queries about can-be-used-as relationships.
  • Field Details

    • types

      public Set<Type> types
      The members of the set.
    • subTypes

      private IMultiMap<Type,Type> 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 supportsCheckpoints
      If true, then mark() and undoLastStep() are supported.
  • Constructor Details

    • SubTypeSet

      public SubTypeSet(boolean supportsCheckpoints)
  • Method Details

    • mark

      public void mark()
      Checkpoint the state of the data structure, for use by undoLastStep().
    • undoLastStep

      public void undoLastStep()
      Undo changes since the last call to mark().
    • add

      public void add(Type c)
      Adds a type to this set.
      Parameters:
      c - the type to be added
    • addQueryType

      private void addQueryType(Type type)
    • getMatches

      public Set<Type> getMatches(Type type)
      Returns all the classes in the set that can-be-used-as the given c.
      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