org.objectweb.dsrg.sofa.repository
Class EntitiesSet

java.lang.Object
  extended by org.objectweb.dsrg.sofa.repository.EntitiesSet

public final class EntitiesSet
extends java.lang.Object

Simple class for building a set of first class entities in the repository. Designed mainly for the purpose of cloning and deleting entities.


Constructor Summary
EntitiesSet()
           
EntitiesSet(Entity[] collection)
           
EntitiesSet(java.lang.Iterable<? extends VersionedEntity> collection)
           
 
Method Summary
 void add(Architecture entity)
          Adds an entity to the set.
 void add(Aspect entity)
          Adds an entity to the set.
 void add(AssemblyDescriptor entity)
          Adds an entity to the set.
 void add(CodeBundle entity)
          Adds an entity to the set.
 void add(DeploymentPlan entity)
          Adds an entity to the set.
 void add(Frame entity)
          Adds an entity to the set.
 void add(InterfaceType entity)
          Adds an entity to the set.
 void add(MicroComponent entity)
          Adds an entity to the set.
 void add(MicroInterfaceType entity)
          Adds an entity to the set.
 void addArchitectures(java.lang.Iterable<Architecture> entities)
          Adds entities to the set.
 void addAspects(java.lang.Iterable<Aspect> entities)
          Adds entities to the set.
 void addAssemblyDescriptors(java.lang.Iterable<AssemblyDescriptor> entities)
          Adds entities to the set.
 void addCodeBundles(java.lang.Iterable<CodeBundle> entities)
          Adds entities to the set.
 void addDeploymentPlans(java.lang.Iterable<DeploymentPlan> entities)
          Adds entities to the set.
 void addFrames(java.lang.Iterable<Frame> entities)
          Adds entities to the set.
 void addInterfaceTypes(java.lang.Iterable<InterfaceType> entities)
          Adds entities to the set.
 void addMicroComponents(java.lang.Iterable<MicroComponent> entities)
          Adds entities to the set.
 void addMicroInterfaceTypes(java.lang.Iterable<MicroInterfaceType> entities)
          Adds entities to the set.
 void addUnknown(VersionedEntity entity)
          Adds an entity to the set.
 boolean contains(Architecture entity)
          Is the entity in the set?
 boolean contains(Aspect entity)
          Is the entity in the set?
 boolean contains(AssemblyDescriptor entity)
          Is the entity in the set?
 boolean contains(CodeBundle entity)
          Is the entity in the set?
 boolean contains(DeploymentPlan entity)
          Is the entity in the set?
 boolean contains(Frame entity)
          Is the entity in the set?
 boolean contains(InterfaceType entity)
          Is the entity in the set?
 boolean contains(MicroComponent entity)
          Is the entity in the set?
 boolean contains(MicroInterfaceType entity)
          Is the entity in the set?
 boolean contains(VersionedEntity entity)
          Is the entity in the set?
 java.util.List<VersionedEntity> getAll()
          Returns list of entities stored in this set.
 java.util.List<Architecture> getArchitectures()
          Returns list of architectures stored in this object.
 java.util.List<Aspect> getAspects()
          Returns list of aspects stored in this object.
 java.util.List<AssemblyDescriptor> getAssemblyDescriptors()
          Returns list of assembly descriptors stored in this object.
 java.util.List<CodeBundle> getCodeBundles()
          Returns list of code bundles stored in this object.
 java.util.List<DeploymentPlan> getDeploymentPlans()
          Returns list of deployment plans stored in this object.
 java.util.List<Frame> getFrames()
          Returns list of frames stored in this object.
 java.util.List<InterfaceType> getInterfaceTypes()
          Returns list of interface types stored in this object.
 java.util.List<MicroComponent> getMicroComponents()
          Returns list of micro components stored in this object.
 java.util.List<MicroInterfaceType> getMicroInterfaceTypes()
          Returns list of microinterface types stored in this object.
static boolean isFirstClass(VersionedEntity entity)
          Is the class of the entity manipulated separately in the repository?
 java.lang.String printContent()
          Prints the names and versions of all contained entities to a String.
 VersionedEntity[] toArray()
          Returns list of entities stored in this set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntitiesSet

public EntitiesSet()

EntitiesSet

public EntitiesSet(java.lang.Iterable<? extends VersionedEntity> collection)
Parameters:
collection - A collection of entities to be included in the set.

EntitiesSet

public EntitiesSet(Entity[] collection)
Parameters:
collection - A collection of entities to be included in the set.
Method Detail

isFirstClass

public static boolean isFirstClass(VersionedEntity entity)
Is the class of the entity manipulated separately in the repository?

Parameters:
entity - The entity class to be evaluated
Returns:
True if the entity is manipulated separately

addUnknown

public void addUnknown(VersionedEntity entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.
Throws:
java.lang.IllegalArgumentException - Argument is not a first class repository entity.

contains

public boolean contains(VersionedEntity entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set
Throws:
java.lang.IllegalArgumentException - Argument is not a first class repository entity.

getAll

public java.util.List<VersionedEntity> getAll()
Returns list of entities stored in this set.

Returns:
list of stored entities (Architectures, InterfaceTypes, ... all together).

toArray

public VersionedEntity[] toArray()
Returns list of entities stored in this set.

Returns:
list of stored entities (Architectures, InterfaceTypes, ... all together).

printContent

public java.lang.String printContent()
Prints the names and versions of all contained entities to a String. For debug purposes.

Returns:
String containing names and versions of all entities in set printed on one line each.

getArchitectures

public java.util.List<Architecture> getArchitectures()
Returns list of architectures stored in this object.

Returns:
list of stored architectures

contains

public boolean contains(Architecture entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(Architecture entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addArchitectures

public void addArchitectures(java.lang.Iterable<Architecture> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getFrames

public java.util.List<Frame> getFrames()
Returns list of frames stored in this object.

Returns:
list of stored frames

contains

public boolean contains(Frame entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(Frame entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addFrames

public void addFrames(java.lang.Iterable<Frame> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getAspects

public java.util.List<Aspect> getAspects()
Returns list of aspects stored in this object.

Returns:
list of stored aspects

contains

public boolean contains(Aspect entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(Aspect entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addAspects

public void addAspects(java.lang.Iterable<Aspect> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getCodeBundles

public java.util.List<CodeBundle> getCodeBundles()
Returns list of code bundles stored in this object.

Returns:
list of stored code bundles

contains

public boolean contains(CodeBundle entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(CodeBundle entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addCodeBundles

public void addCodeBundles(java.lang.Iterable<CodeBundle> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getAssemblyDescriptors

public java.util.List<AssemblyDescriptor> getAssemblyDescriptors()
Returns list of assembly descriptors stored in this object.

Returns:
list of stored assembly descriptors

contains

public boolean contains(AssemblyDescriptor entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(AssemblyDescriptor entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addAssemblyDescriptors

public void addAssemblyDescriptors(java.lang.Iterable<AssemblyDescriptor> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getInterfaceTypes

public java.util.List<InterfaceType> getInterfaceTypes()
Returns list of interface types stored in this object.

Returns:
list of stored interface types

contains

public boolean contains(InterfaceType entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(InterfaceType entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addInterfaceTypes

public void addInterfaceTypes(java.lang.Iterable<InterfaceType> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getDeploymentPlans

public java.util.List<DeploymentPlan> getDeploymentPlans()
Returns list of deployment plans stored in this object.

Returns:
list of stored deployment plans

contains

public boolean contains(DeploymentPlan entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(DeploymentPlan entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addDeploymentPlans

public void addDeploymentPlans(java.lang.Iterable<DeploymentPlan> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getMicroComponents

public java.util.List<MicroComponent> getMicroComponents()
Returns list of micro components stored in this object.

Returns:
list of stored micro components

contains

public boolean contains(MicroComponent entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(MicroComponent entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addMicroComponents

public void addMicroComponents(java.lang.Iterable<MicroComponent> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.

getMicroInterfaceTypes

public java.util.List<MicroInterfaceType> getMicroInterfaceTypes()
Returns list of microinterface types stored in this object.

Returns:
list of stored microinterface types

contains

public boolean contains(MicroInterfaceType entity)
Is the entity in the set?

Parameters:
entity - The entity to be searched
Returns:
True if the entity is in the set

add

public void add(MicroInterfaceType entity)
Adds an entity to the set.

Parameters:
entity - The entity that should be added.

addMicroInterfaceTypes

public void addMicroInterfaceTypes(java.lang.Iterable<MicroInterfaceType> entities)
Adds entities to the set.

Parameters:
entity - The entities that should be added.