ReferencePathNode.kt
TLDR
The provided file defines a sealed class ReferencePathNode
and its subclasses. It also includes nested classes and interfaces.
Classes
ReferencePathNode
The ReferencePathNode
class is a sealed class that represents a node in a reference path. It is an abstract class that has an objectId
property of type Long.
Subclasses:
-
RootNode
: A sealed class that represents a root node in the reference path. It inherits fromReferencePathNode
and has an additionalgcRoot
property of typeGcRoot
. It also overrides theobjectId
property to return theid
of thegcRoot
.-
LibraryLeakRootNode
: A class that represents a library leak root node. It inherits fromRootNode
and has an additionalmatcher
property of typeLibraryLeakReferenceMatcher
. -
NormalRootNode
: A class that represents a normal root node. It inherits fromRootNode
.
-
-
ChildNode
: A class that represents a child node in the reference path. It inherits fromReferencePathNode
and has an additionalparent
property of typeReferencePathNode
and alazyDetailsResolver
property of typeLazyDetails.Resolver
.
Note: There are no methods in the provided file.
package shark.internal
import shark.GcRoot
import shark.LibraryLeakReferenceMatcher
import shark.Reference.LazyDetails
sealed class ReferencePathNode {
abstract val objectId: Long
sealed class RootNode : ReferencePathNode() {
abstract val gcRoot: GcRoot
override val objectId: Long
get() = gcRoot.id
class LibraryLeakRootNode(
override val gcRoot: GcRoot,
val matcher: LibraryLeakReferenceMatcher
) : RootNode()
class NormalRootNode(
override val gcRoot: GcRoot
) : RootNode()
}
class ChildNode(
override val objectId: Long,
/**
* The reference from the parent to this node
*/
val parent: ReferencePathNode,
val lazyDetailsResolver: LazyDetails.Resolver,
) : ReferencePathNode()
}