org.jdtaus.core.container
Class Modules

java.lang.Object
  extended by org.jdtaus.core.container.ModelObject
      extended by org.jdtaus.core.container.Modules
All Implemented Interfaces:
Serializable, Cloneable

public class Modules
extends ModelObject
implements Cloneable, Serializable

Collection of modules.

Version:
$Id: Modules.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte
See Also:
Serialized Form

Constructor Summary
Modules()
           
 
Method Summary
 Object clone()
          Creates and returns a deep copy of this object.
 boolean equals(Object o)
          Indicates whether some other object is equal to this one by comparing the values of all properties.
 Implementation getImplementation(String identifier)
          Gets an implementation for an identifier.
 Implementations getImplementations()
          Gets a collection of all implementations of all modules held by the instance.
 Module getModule(int index)
          Gets a module for an index.
 Module getModule(String name)
          Gets a module for a name.
 Module[] getModules()
          Gets the modules of the collection.
 Specification getSpecification(String identifier)
          Gets a specification for an identifier.
 Specifications getSpecifications()
          Gets a collection of all specifications of all modules.
 int hashCode()
          Returns a hash code value for this object.
 void setModules(Module[] value)
          Setter for property modules.
 int size()
          Gets the number of modules held by the instance.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jdtaus.core.container.ModelObject
getDocumentation, getModelVersion, setDocumentation, setModelVersion
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Modules

public Modules()
Method Detail

clone

public Object clone()
Creates and returns a deep copy of this object.

Overrides:
clone in class Object
Returns:
a clone of this instance.

equals

public boolean equals(Object o)
Indicates whether some other object is equal to this one by comparing the values of all properties.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as o; false otherwise.

getImplementation

public Implementation getImplementation(String identifier)
Gets an implementation for an identifier.

Parameters:
identifier - the identifier of the implementation to return.
Returns:
a reference to the implementation identified by identifier.
Throws:
NullPointerException - if identifier is null.
MissingImplementationException - if no implementation matching identifier exists.

getImplementations

public Implementations getImplementations()
Gets a collection of all implementations of all modules held by the instance.

Returns:
a reference to all implementations of all modules held by the instance.

getModule

public final Module getModule(int index)
Gets a module for an index.

Parameters:
index - the index of the module to return.
Returns:
a reference to the module at index.
Throws:
IndexOutOfBoundsException - if index is negativ, greater than or equal to size().

getModule

public Module getModule(String name)
Gets a module for a name.

Parameters:
name - the name of the module to return.
Returns:
a reference to the module named name.
Throws:
NullPointerException - if name is null.
MissingModuleException - if no module matching name exists in the collection.

getModules

public Module[] getModules()
Gets the modules of the collection.

Returns:
the modules of the collection.

getSpecification

public Specification getSpecification(String identifier)
Gets a specification for an identifier.

Parameters:
identifier - the identifier of the specification to return.
Returns:
a reference to the specification identified by identifier.
Throws:
NullPointerException - if identifier is null.
MissingSpecificationException - if no specification matching identifier exists.

getSpecifications

public Specifications getSpecifications()
Gets a collection of all specifications of all modules.

Returns:
a reference to all specifications of all modules held by the instance.

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.

setModules

public void setModules(Module[] value)
Setter for property modules.

Parameters:
value - the new collection of modules.
Throws:
DuplicateModuleException - if value contains duplicate modules.
DuplicateSpecificationException - if value contains duplicate specifications.
DuplicateImplementationException - if value contains duplicate implementations.

size

public final int size()
Gets the number of modules held by the instance.

Returns:
the number of modules held by the instance.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.