jdepend.framework

Class JavaPackage

public class JavaPackage extends Object

The JavaPackage class represents a Java package.

Author: Mike Clark Clarkware Consulting, Inc.

Constructor Summary
JavaPackage(String name)
JavaPackage(String name, int volatility)
Method Summary
floatabstractness()
voidaddAfferent(JavaPackage jPackage)
Adds the specified Java package as an afferent of this package.
voidaddClass(JavaClass clazz)
voidaddEfferent(JavaPackage jPackage)
intafferentCoupling()
booleancollectAllCycles(List list)
Collects all the packages participating in a package dependency cycle which originates from this package.
booleancollectCycle(List list)
Collects the packages participating in the first package dependency cycle detected which originates from this package.
booleancontainsCycle()
voiddependsUpon(JavaPackage imported)
Adds the specified Java package as an efferent of this package and adds this package as an afferent of it.
floatdistance()
intefferentCoupling()
booleanequals(Object other)
intgetAbstractClassCount()
CollectiongetAfferents()
intgetClassCount()
CollectiongetClasses()
intgetConcreteClassCount()
CollectiongetEfferents()
StringgetName()
intgetVolatility()
inthashCode()
floatinstability()
voidsetAfferents(Collection afferents)
voidsetEfferents(Collection efferents)
voidsetVolatility(int v)

Constructor Detail

JavaPackage

public JavaPackage(String name)

JavaPackage

public JavaPackage(String name, int volatility)

Method Detail

abstractness

public float abstractness()

Returns: The package's abstractness (0-1).

addAfferent

public void addAfferent(JavaPackage jPackage)
Adds the specified Java package as an afferent of this package.

Parameters: jPackage Java package.

addClass

public void addClass(JavaClass clazz)

addEfferent

public void addEfferent(JavaPackage jPackage)

afferentCoupling

public int afferentCoupling()

Returns: The afferent coupling (Ca) of this package.

collectAllCycles

public boolean collectAllCycles(List list)
Collects all the packages participating in a package dependency cycle which originates from this package.

This is a more exhaustive search than that employed by collectCycle.

Parameters: list Collecting object to be populated with the list of JavaPackage instances in a cycle.

Returns: true if a cycle exist; false otherwise.

collectCycle

public boolean collectCycle(List list)
Collects the packages participating in the first package dependency cycle detected which originates from this package.

Parameters: list Collecting object to be populated with the list of JavaPackage instances in a cycle.

Returns: true if a cycle exist; false otherwise.

containsCycle

public boolean containsCycle()

dependsUpon

public void dependsUpon(JavaPackage imported)
Adds the specified Java package as an efferent of this package and adds this package as an afferent of it.

Parameters: imported Java package.

distance

public float distance()

Returns: The package's distance from the main sequence (D).

efferentCoupling

public int efferentCoupling()

Returns: The efferent coupling (Ce) of this package.

equals

public boolean equals(Object other)

getAbstractClassCount

public int getAbstractClassCount()

getAfferents

public Collection getAfferents()

getClassCount

public int getClassCount()

getClasses

public Collection getClasses()

getConcreteClassCount

public int getConcreteClassCount()

getEfferents

public Collection getEfferents()

getName

public String getName()

getVolatility

public int getVolatility()

Returns: The package's volatility (0-1).

hashCode

public int hashCode()

instability

public float instability()

Returns: Instability (0-1).

setAfferents

public void setAfferents(Collection afferents)

setEfferents

public void setEfferents(Collection efferents)

setVolatility

public void setVolatility(int v)

Parameters: v Volatility (0-1).

Copyright B) 1999-2005 Clarkware Consulting, Inc.