at.ac.tuwien.infosys.sm4all.copal.api.util
Class Attributes

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.util.BaseObservable<RegistryObservable.RegistrationState,V,RegistryObservable.RegistryObserver<V>>
      extended by at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry<java.lang.String,Attribute>
          extended by at.ac.tuwien.infosys.sm4all.copal.api.util.Attributes
All Implemented Interfaces:
Observable<RegistryObservable.RegistrationState,Attribute,RegistryObservable.RegistryObserver<Attribute>>, Registry<java.lang.String,Attribute>, RegistryObservable<Attribute>

public class Attributes
extends BaseRegistry<java.lang.String,Attribute>

Implementation of a Registry for Attributes.

Author:
sanjin

Nested Class Summary
 
Nested classes/interfaces inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.util.RegistryObservable
RegistryObservable.RegistrationState, RegistryObservable.RegistryObserver<T>
 
Constructor Summary
Attributes()
          Create instance of empty Attribute Registry.
Attributes(Attribute... attributes)
          Create instance of Attribute Registry that has specified Attributes registered.
 
Method Summary
 Attribute get(java.lang.String name)
          Returns Attribute with specified name.
 Attribute[] getAll()
          Returns all currently registered Attributes.
protected  java.lang.String getKey(Attribute attribute)
          Return the key for specified value.
 boolean isRegistered(java.lang.String name)
          Returns if an Attribute with specified name is currently registered.
 void register(Attribute attribute)
          Register specified Attribute.
 void setAll(Attribute... attributes)
          Register specified Attributes and remove all previously registered Attributes.
 void unregister(java.lang.String name)
          Unregister Attribute with specified name.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry
attach, detach, getValues, set, setValues, unregisterAll
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseObservable
detachAll, getObservers, notifyAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attributes

public Attributes()
Create instance of empty Attribute Registry.


Attributes

public Attributes(Attribute... attributes)
Create instance of Attribute Registry that has specified Attributes registered.

Parameters:
attributes - the Attributes.
Throws:
java.lang.NullPointerException - if specified array of Attributes or any Attribute in the array is null.
Method Detail

register

public void register(Attribute attribute)
Register specified Attribute.

Specified by:
register in interface Registry<java.lang.String,Attribute>
Overrides:
register in class BaseRegistry<java.lang.String,Attribute>
Parameters:
attribute - the Attribute.
Throws:
java.lang.NullPointerException - if specified Attribute is null.
See Also:
BaseRegistry.set(Object...)

unregister

public void unregister(java.lang.String name)
Unregister Attribute with specified name.

Specified by:
unregister in interface Registry<java.lang.String,Attribute>
Overrides:
unregister in class BaseRegistry<java.lang.String,Attribute>
Parameters:
name - the name of the Attribute.

isRegistered

public boolean isRegistered(java.lang.String name)
Returns if an Attribute with specified name is currently registered.

Specified by:
isRegistered in interface Registry<java.lang.String,Attribute>
Overrides:
isRegistered in class BaseRegistry<java.lang.String,Attribute>
Parameters:
name - the name of the Attribute.
Returns:
if an Attribute with specified name is currently registered.

get

public Attribute get(java.lang.String name)
Returns Attribute with specified name.

Specified by:
get in interface Registry<java.lang.String,Attribute>
Overrides:
get in class BaseRegistry<java.lang.String,Attribute>
Parameters:
name - the name of the Attribute.
Returns:
the Attribute or null if there is no such Attribute registered.

getAll

public Attribute[] getAll()
Returns all currently registered Attributes.

Returns:
all currently registered Attributes.

setAll

public void setAll(Attribute... attributes)
Register specified Attributes and remove all previously registered Attributes.

Parameters:
attributes - the Attributes.
Throws:
java.lang.NullPointerException - if specified array of Attributes or any Attribute in the array is null.

getKey

protected java.lang.String getKey(Attribute attribute)
Description copied from class: BaseRegistry
Return the key for specified value.

Specified by:
getKey in class BaseRegistry<java.lang.String,Attribute>
Parameters:
attribute - the value.
Returns:
the key.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.