eu.xtreemos.xosd.localallocmgr.attributes.storage
Class AttributeStorage

java.lang.Object
  extended by eu.xtreemos.xosd.localallocmgr.attributes.storage.AttributeStorage
All Implemented Interfaces:
java.io.Serializable

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

An object can have only one instance of some attribute. The reason for such decision lies in type-safety of the attributes. If there is a need for a group of same attributes, create a new class that handles such group. Again, the reason is purely semantical nature and the design is chosen to enforce strict types. Attribute is obtained either by enumeration or by the class name. TODO: there is no need for the IAttribute class any more!!!

Author:
urosjovanovic
See Also:
Serialized Form

Field Summary
(package private)  java.util.Hashtable<java.lang.Class<?>,IAttribute<?>> attributes
           
 
Constructor Summary
AttributeStorage()
           
 
Method Summary
 void add(IAttribute<?> attribute)
           
 void addButTimeAttribs(AttributeStorage another)
          adds all attributes but time attributes (in order to leave TTElm time unchanged)
 AttributeStorage clone()
          expected that all attributes have clones.
 boolean conformsTo(java.lang.Class<?> attrClass)
           
 boolean equals(AttributeStorage another)
          if this is a proper subset of another attributes, and those attributes are proper subset of these attributes, then the set of attributes are the same
 boolean equalsButTime(AttributeStorage another)
          equal all attributes but time attributes
 IAttribute<?> get(java.lang.Class<?> attrClass)
           
 java.util.Collection<IAttribute<?>> getAttributes()
           
 java.util.Collection<java.lang.Class<?>> getAttributeTypes()
           
 boolean has(java.lang.Class<?> type)
           
 boolean hasJustBasicAttribs()
           
 void remove(java.lang.Class<?> attrClass)
           
 java.util.Hashtable<java.lang.Class<?>,java.lang.Object> toConstraints()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

java.util.Hashtable<java.lang.Class<?>,IAttribute<?>> attributes
Constructor Detail

AttributeStorage

public AttributeStorage()
Method Detail

add

public void add(IAttribute<?> attribute)

has

public boolean has(java.lang.Class<?> type)

get

public IAttribute<?> get(java.lang.Class<?> attrClass)

remove

public void remove(java.lang.Class<?> attrClass)

getAttributes

public java.util.Collection<IAttribute<?>> getAttributes()

getAttributeTypes

public java.util.Collection<java.lang.Class<?>> getAttributeTypes()

conformsTo

public boolean conformsTo(java.lang.Class<?> attrClass)

toConstraints

public java.util.Hashtable<java.lang.Class<?>,java.lang.Object> toConstraints()

clone

public AttributeStorage clone()
expected that all attributes have clones.

Overrides:
clone in class java.lang.Object

addButTimeAttribs

public void addButTimeAttribs(AttributeStorage another)
adds all attributes but time attributes (in order to leave TTElm time unchanged)

Parameters:
another -

equals

public boolean equals(AttributeStorage another)
if this is a proper subset of another attributes, and those attributes are proper subset of these attributes, then the set of attributes are the same

Parameters:
another -
Returns:

equalsButTime

public boolean equalsButTime(AttributeStorage another)
equal all attributes but time attributes

Parameters:
another -
Returns:

hasJustBasicAttribs

public boolean hasJustBasicAttribs()