ch.elca.dependency.core.classinfo
Class ClassInfo

java.lang.Object
  |
  +--ch.elca.dependency.core.classinfo.ClassInfo
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class ClassInfo
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable

This class acts particuarly as struct. It holds the dependencies of the specified class, the class name and its package name. This class is, if it is constructed once, always valid. Invalid values are not allowed in the constructor where that's the only way to initialize this object.

Version:
1.0-beta
Author:
Christoph Trutmann
See Also:
Reader, Analyzer

Constructor Summary
ClassInfo(java.lang.String fullName, java.lang.String superClass, java.util.ArrayList dependencies, java.util.ArrayList packDepend, java.util.HashSet interfaces)
          Constructor - Allows only direct initialisation at the beginning.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this object.
 int compareTo(java.lang.Object o)
          Compares the names of two ClassInfo objects.
 java.lang.String getClassName()
          Gets the name of the class where the informations belong to.
 java.lang.String getFullName()
          Gets the full qualified name of this class.
 java.util.HashSet getImplInterfaces()
          Gets a HashSet with all the implemented interfaces of the current class.
 java.util.ArrayList getNeededClasses()
          Gets the list with the classes nedded by this class specified here.
 java.util.ArrayList getNeededPackages()
          Gets the list with the packages needed by the class specified here.
 java.lang.String getPackage()
          Gets the mane of the package where the informations belong to.
 java.lang.String getSuperClass()
          Gets the super class of this class.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInfo

public ClassInfo(java.lang.String fullName,
                 java.lang.String superClass,
                 java.util.ArrayList dependencies,
                 java.util.ArrayList packDepend,
                 java.util.HashSet interfaces)
          throws java.lang.IllegalArgumentException
Constructor - Allows only direct initialisation at the beginning.

Parameters:
fullName - Full qualified name of the class where this information belongs to.
superClass - Super class of this class.
dependencies - All the classes which are 'used' by the class where this information belongs to. Also these classes are stored with the full qualified name.
packDepend - All the packages which are 'used' by this class.
interfaces - Implemented interfaces by this class.
Throws:
java.lang.IllegalArgumentException - If there are wrong arguments passed or if some arguments are missed.
Method Detail

getClassName

public java.lang.String getClassName()
                              throws ClassInfoException
Gets the name of the class where the informations belong to.

Returns:
Name of the class.
Throws:
ClassInfoException - If the class informations are invalid.

getPackage

public java.lang.String getPackage()
                            throws ClassInfoException
Gets the mane of the package where the informations belong to.

Returns:
Name of the package.
Throws:
ClassInfoException - If the class informations are invalid.

getFullName

public java.lang.String getFullName()
Gets the full qualified name of this class.

Returns:
Full qualified name of this class.

getSuperClass

public java.lang.String getSuperClass()
Gets the super class of this class.

Returns:
Super class in the full qualified name string.

getNeededPackages

public java.util.ArrayList getNeededPackages()
Gets the list with the packages needed by the class specified here. These packages are specified in the full qualified name.

Returns:
ArrayList with all the packages needed by the spec. class.

getNeededClasses

public java.util.ArrayList getNeededClasses()
Gets the list with the classes nedded by this class specified here. These classes are specified in the full qualified name.

Returns:
ArrayList with all the classes needed by the spec. class.

getImplInterfaces

public java.util.HashSet getImplInterfaces()
Gets a HashSet with all the implemented interfaces of the current class.

Returns:
HashSet with all the implemented interfaces.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
A clone of this instance.
Throws:
java.lang.CloneNotSupportedException - If the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

compareTo

public int compareTo(java.lang.Object o)
Compares the names of two ClassInfo objects.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.


Copyright © 2003 ELCA Informatique SA. All Rights Reserved.