Package jdepend.framework
Class JavaPackage
- java.lang.Object
-
- jdepend.framework.JavaPackage
-
public class JavaPackage extends java.lang.ObjectTheJavaPackageclass represents a Java package.- Author:
- Mike Clark, Clarkware Consulting, Inc.
-
-
Constructor Summary
Constructors Constructor Description JavaPackage(java.lang.String name)JavaPackage(java.lang.String name, int volatility)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatabstractness()voidaddAfferent(JavaPackage jPackage)Adds the specified Java package as an afferent of this package.voidaddClass(JavaClass clazz)voidaddEfferent(JavaPackage jPackage)intafferentCoupling()booleancollectAllCycles(java.util.List list)Collects all the packages participating in a package dependency cycle which originates from this package.booleancollectCycle(java.util.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(java.lang.Object other)intgetAbstractClassCount()java.util.CollectiongetAfferents()intgetClassCount()java.util.CollectiongetClasses()intgetConcreteClassCount()java.util.CollectiongetEfferents()java.lang.StringgetName()intgetVolatility()inthashCode()floatinstability()voidsetAfferents(java.util.Collection afferents)voidsetEfferents(java.util.Collection efferents)voidsetVolatility(int v)java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getVolatility
public int getVolatility()
- Returns:
- The package's volatility (0-1).
-
setVolatility
public void setVolatility(int v)
- Parameters:
v- Volatility (0-1).
-
containsCycle
public boolean containsCycle()
-
collectCycle
public boolean collectCycle(java.util.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:
trueif a cycle exist;falseotherwise.
-
collectAllCycles
public boolean collectAllCycles(java.util.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:
trueif a cycle exist;falseotherwise.
-
addClass
public void addClass(JavaClass clazz)
-
getClasses
public java.util.Collection getClasses()
-
getClassCount
public int getClassCount()
-
getAbstractClassCount
public int getAbstractClassCount()
-
getConcreteClassCount
public int getConcreteClassCount()
-
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.
-
addAfferent
public void addAfferent(JavaPackage jPackage)
Adds the specified Java package as an afferent of this package.- Parameters:
jPackage- Java package.
-
getAfferents
public java.util.Collection getAfferents()
-
setAfferents
public void setAfferents(java.util.Collection afferents)
-
addEfferent
public void addEfferent(JavaPackage jPackage)
-
getEfferents
public java.util.Collection getEfferents()
-
setEfferents
public void setEfferents(java.util.Collection efferents)
-
afferentCoupling
public int afferentCoupling()
- Returns:
- The afferent coupling (Ca) of this package.
-
efferentCoupling
public int efferentCoupling()
- Returns:
- The efferent coupling (Ce) of this package.
-
instability
public float instability()
- Returns:
- Instability (0-1).
-
abstractness
public float abstractness()
- Returns:
- The package's abstractness (0-1).
-
distance
public float distance()
- Returns:
- The package's distance from the main sequence (D).
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-