public class JavaPackage
extends java.lang.Object
JavaPackage
class represents
a Java package.Constructor and Description |
---|
JavaPackage(java.lang.String name)
Constructs a
JavaPackage instance with
the specified package name. |
Modifier and Type | Method and Description |
---|---|
float |
abstractness()
Returns the abstractness (A) of this package.
|
void |
addAfferent(JavaPackage jPackage)
Adds the specified Java package as an afferent
of this package.
|
void |
addClass(JavaClass jClass)
Adds the specified Java class to the package.
|
void |
addEfferent(JavaPackage jPackage)
Adds the specified Java package as an efferent
of this package.
|
int |
afferentCoupling()
Returns the afferent coupling (Ca) of this package.
|
boolean |
collectCycle(java.util.List list)
Collects the packages participating in a
package dependency cycle.
|
boolean |
containsCycle()
Indicates whether the package contains
a package dependency cycle.
|
void |
dependsUpon(JavaPackage imported)
Adds the specified Java package as an efferent
of this package and adds this package as an
afferent of it.
|
float |
distance()
Returns this package's distance from the main sequence (D).
|
int |
efferentCoupling()
Returns the efferent coupling (Ce) of this package.
|
boolean |
equals(java.lang.Object other)
Indicates whether the specified package is equal
to this package.
|
boolean |
equalsAfferents(java.lang.Object other)
Indicates whether the specified package is equal
to this package in terms of its afferent couplings.
|
boolean |
equalsDependencies(java.lang.Object other)
Indicates whether the specified package is equal
to this package in terms of its afferent and
efferent couplings.
|
boolean |
equalsEfferents(java.lang.Object other)
Indicates whether the specified package is equal
to this package in terms of its efferent couplings.
|
int |
getAbstractClassCount()
Returns the number of abstract classes
(and interfaces) in this package.
|
java.util.Collection |
getAfferents()
Returns the collection of afferent packages.
|
int |
getClassCount()
Returns the total number of classes in
this package.
|
java.util.Collection |
getClasses()
Returns the collection of Java classes
in this package.
|
int |
getConcreteClassCount()
Returns the number of concrete classes in
this package.
|
java.util.Collection |
getEfferents()
Returns the collection of efferent packages.
|
java.lang.String |
getName()
Returns the name.
|
float |
instability()
Returns the instability (I) of this package.
|
void |
setAfferents(java.util.Collection afferents)
Sets the collection of afferent packages.
|
void |
setEfferents(java.util.Collection efferents)
Sets the collection of efferent packages.
|
public JavaPackage(java.lang.String name)
JavaPackage
instance with
the specified package name.name
- Package name.public java.lang.String getName()
public boolean containsCycle()
true
if a cycle exist;
false
otherwise.public boolean collectCycle(java.util.List list)
list
- Collecting object to be populated with
the list of JavaPackage instances in a cycle.true
if a cycle exist;
false
otherwise.public void addClass(JavaClass jClass)
jClass
- Java class to add.public java.util.Collection getClasses()
public int getClassCount()
public int getAbstractClassCount()
public int getConcreteClassCount()
public void dependsUpon(JavaPackage imported)
imported
- Java package.public void addAfferent(JavaPackage jPackage)
jPackage
- Java package.public java.util.Collection getAfferents()
public void setAfferents(java.util.Collection afferents)
afferents
- Collection of afferent packages.public void addEfferent(JavaPackage jPackage)
jPackage
- Java package.public java.util.Collection getEfferents()
public void setEfferents(java.util.Collection efferents)
efferents
- Collection of efferent packages.public int afferentCoupling()
public int efferentCoupling()
public float instability()
public float abstractness()
public float distance()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- Other package.true
if the packages are equal;
false
otherwise.public boolean equalsDependencies(java.lang.Object other)
other
- Other package.true
if the packages are equal;
false
otherwise.public boolean equalsAfferents(java.lang.Object other)
other
- Other package.true
if the packages are equal;
false
otherwise.public boolean equalsEfferents(java.lang.Object other)
other
- Other package.true
if the packages are equal;
false
otherwise.Copyright ? 1999-2002 Clarkware Consulting, Inc. All Rights Reserved.