eu.xtreemos.xosd.localallocmgr.basic
Class TTElm

java.lang.Object
  extended by eu.xtreemos.xosd.localallocmgr.basic.TTElm
All Implemented Interfaces:
java.io.Serializable

public class TTElm
extends java.lang.Object
implements java.io.Serializable

Basic element of the timetable. The element holds values that are used for scheduling in the time table.
Since all the attributes can not be known in advance, the design of the ttelm goes as follows:

Such design allows to add attributes and different ways to handle them without altering the basic element.
TTElm is thus seen as a storage for the attributes. The attributes are accessed by their types (classes). Each TTElm (for now) has a set of basic attributes, which are StartTime, EndTime and Sharing, determining the info about the time references for the time table element and also about the type of locking (mutual/exclusive).
Note that TTElm allows only one instance of an attribute of a certain class/type.

Author:
urosjovanovic
See Also:
Serialized Form

Field Summary
 AttributeStorage attributes
           
 
Constructor Summary
TTElm()
           
 
Method Summary
 IAttribute<?> getAttribute(java.lang.Class type)
          Returns the whole attribute object for the requested class/type of an attribute.
 java.lang.Object getAttributeValue(java.lang.Class type)
          Returns the attribute value as an Object, defined by the type (class) of the attribute.
 boolean hasAttribute(java.lang.Class type)
           
 boolean hasEqualAttributes(TTElm another)
          Returns the info about the question whether two elements have the same attributes (not only by the type but also by the value).
 boolean hasJustBasicInfo()
          returns true if the elm only holds info about start, end and sharing type. this means, that after the element is removed by attributes, and it holds no basic info, then the element can be removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

public AttributeStorage attributes
Constructor Detail

TTElm

public TTElm()
Method Detail

getAttribute

public IAttribute<?> getAttribute(java.lang.Class type)
Returns the whole attribute object for the requested class/type of an attribute.

Parameters:
type -
Returns:

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.Class type)
                                   throws AttributeConformanceException
Returns the attribute value as an Object, defined by the type (class) of the attribute.

Parameters:
type -
Returns:
Throws:
AttributeConformanceException

hasEqualAttributes

public boolean hasEqualAttributes(TTElm another)
Returns the info about the question whether two elements have the same attributes (not only by the type but also by the value).

Parameters:
another -
Returns:

hasAttribute

public boolean hasAttribute(java.lang.Class type)

hasJustBasicInfo

public boolean hasJustBasicInfo()
returns true if the elm only holds info about start, end and sharing type. this means, that after the element is removed by attributes, and it holds no basic info, then the element can be removed.

Returns: