Module aya.base
Package org.aya.terck

Record Class CallGraph<T,P>

java.lang.Object
java.lang.Record
org.aya.terck.CallGraph<T,P>

public record CallGraph<T,P>(@NotNull kala.collection.mutable.MutableMap<T,@NotNull kala.collection.mutable.MutableMap<T,kala.collection.mutable.MutableList<@NotNull CallMatrix<T,P>>>> graph) extends Record
Call graph is a multi-graph; each vertex represents a definition and each edge from vertex `f` to vertex `g` represents a call to `g` within `f`. The edges are labeled with call matrices, and can be labelled with several call matrices if there are several paths from `f` to `g`.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    CallGraph(@NotNull kala.collection.mutable.MutableMap<T,@NotNull kala.collection.mutable.MutableMap<T,kala.collection.mutable.MutableList<@NotNull CallMatrix<T,P>>>> graph)
    Creates an instance of a CallGraph record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T, P> @NotNull CallGraph<T,P>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    @NotNull kala.collection.immutable.ImmutableSeq<Diagonal<T,P>>
    find bad recursive calls in current SCC
    static <K, V> void
    forEachGraph(@NotNull kala.collection.mutable.MutableMap<K,kala.collection.mutable.MutableMap<K,V>> a, @NotNull kala.collection.mutable.MutableMap<K,kala.collection.mutable.MutableMap<K,V>> b, @NotNull Consumer<V> inA, @NotNull Consumer<V> inB, @NotNull BiConsumer<V,V> both)
     
    static <K, V> void
    forEachMap(@NotNull kala.collection.mutable.MutableMap<K,V> a, @NotNull kala.collection.mutable.MutableMap<K,V> b, @NotNull Consumer<V> inA, @NotNull Consumer<V> inB, @NotNull BiConsumer<V,V> both)
     
    @NotNull kala.collection.mutable.MutableMap<T,@NotNull kala.collection.mutable.MutableMap<T,kala.collection.mutable.MutableList<@NotNull CallMatrix<T,P>>>>
    Returns the value of the graph record component.
    final int
    Returns a hash code value for this object.
    boolean
     
    void
    put(@NotNull CallMatrix<T,P> matrix)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CallGraph

      public CallGraph(@NotNull @NotNull kala.collection.mutable.MutableMap<T,@NotNull kala.collection.mutable.MutableMap<T,kala.collection.mutable.MutableList<@NotNull CallMatrix<T,P>>>> graph)
      Creates an instance of a CallGraph record class.
      Parameters:
      graph - the value for the graph record component
  • Method Details

    • create

      @NotNull public static <T, P> @NotNull CallGraph<T,P> create()
    • put

      public void put(@NotNull @NotNull CallMatrix<T,P> matrix)
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if there's no edge
    • forEachGraph

      public static <K, V> void forEachGraph(@NotNull @NotNull kala.collection.mutable.MutableMap<K,kala.collection.mutable.MutableMap<K,V>> a, @NotNull @NotNull kala.collection.mutable.MutableMap<K,kala.collection.mutable.MutableMap<K,V>> b, @NotNull @NotNull Consumer<V> inA, @NotNull @NotNull Consumer<V> inB, @NotNull @NotNull BiConsumer<V,V> both)
    • forEachMap

      public static <K, V> void forEachMap(@NotNull @NotNull kala.collection.mutable.MutableMap<K,V> a, @NotNull @NotNull kala.collection.mutable.MutableMap<K,V> b, @NotNull @NotNull Consumer<V> inA, @NotNull @NotNull Consumer<V> inB, @NotNull @NotNull BiConsumer<V,V> both)
    • findBadRecursion

      @NotNull public @NotNull kala.collection.immutable.ImmutableSeq<Diagonal<T,P>> findBadRecursion()
      find bad recursive calls in current SCC
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • graph

      @NotNull public @NotNull kala.collection.mutable.MutableMap<T,@NotNull kala.collection.mutable.MutableMap<T,kala.collection.mutable.MutableList<@NotNull CallMatrix<T,P>>>> graph()
      Returns the value of the graph record component.
      Returns:
      the value of the graph record component