edu.UCL.satin.impl.container
Class ComponentVersions

java.lang.Object
  extended byedu.UCL.satin.impl.container.ComponentVersions

public class ComponentVersions
extends java.lang.Object

This class is a collection of different versions of a component. It assumes that components have a a VER attribute that stores the version as an Integer object

Author:
Stefanos Zachariadis

Field Summary
private  GenericAttribute id
           
private  java.util.TreeMap versions
           
 
Constructor Summary
ComponentVersions(Component c)
          Creates a new list of versions for this particular component
 
Method Summary
 void addVersion(Component c)
          Adds a different version of this component to the list
 boolean containsVersion(java.lang.Object version)
          Checks whether the version given exists in this datastructure
 Component getLatestVersion()
          Returns the latest version of this component available
 java.util.Enumeration getVersions()
          Returns the list of all versions available for this component
 void removeVersion(Component c)
          Removes a version of this component from the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versions

private java.util.TreeMap versions

id

private GenericAttribute id
Constructor Detail

ComponentVersions

public ComponentVersions(Component c)
Creates a new list of versions for this particular component

Method Detail

addVersion

public void addVersion(Component c)
Adds a different version of this component to the list

Parameters:
c - The different version of the component.

containsVersion

public boolean containsVersion(java.lang.Object version)
Checks whether the version given exists in this datastructure

Parameters:
version -
Returns:

removeVersion

public void removeVersion(Component c)
Removes a version of this component from the list

Parameters:
c - The version of the component to remove

getVersions

public java.util.Enumeration getVersions()
Returns the list of all versions available for this component

Returns:
an enumeration of all different component versions available

getLatestVersion

public Component getLatestVersion()
Returns the latest version of this component available

Returns:
the latest version of this component