countExternalParents

abstract fun countExternalParents(indirectParents: Boolean = false, predicate: (KoParentDeclaration) -> Boolean): Int

Returns the number of external parents that satisfies the specified predicate present in the declaration.

Return

The number of external parents in the declaration satisfying predicate.

Parameters

indirectParents

specifies whether to include external parents defined in other files such as parent of the parent. If true, it includes only those external parents defined within our scope and those used by our declarations. For example:

// Android
class AppCompactActivity: Activity
interface Activity

// Project
class BaseActivity: AppCompactActivity() // externalParents(indirectParents = true) returns [AppCompactActivity]
class MyActivity: BaseActivity() // externalParents(indirectParents = true) returns [AppCompactActivity]
predicate

The predicate function to determine if an external parent satisfies a condition.