com.tensegrity.generic.attribute
Class AttributeFactory

java.lang.Object
  extended bycom.tensegrity.generic.attribute.AttributeFactory

public abstract class AttributeFactory
extends java.lang.Object

The abstract base class defining the methods needed to build an AttributeFactory. This factory produces new Attribute, AttributeSet and AttributeList instances.

Version:
$Id: AttributeFactory.java,v 1.26 2005/07/28 09:46:18 BurkhardWick Exp $
Author:
M. Kegel,

Constructor Summary
AttributeFactory()
          Default constructor.
 
Method Summary
abstract  Attribute immutableAttribute(Attribute attribute)
           Returns a wrapper Attribute instance that turns the Attribute given by attribute into an immutable one, though the method Attribute.isMutable() will still return the value of the wrapped attribute.
abstract  AttributeSet immutableAttributeSet(AttributeSet set)
           Returns a wrapper AttributeSet instance that turns the AttributeSet given by set into an immutable one.
abstract  Attribute newAttribute(java.lang.String name, java.lang.Object value)
          This method returns an Attribute with given name and value.
abstract  Attribute newAttribute(java.lang.String name, java.lang.Object value, Constraint constraint)
          This method return an Attribute with given name, value and constraint.
abstract  AttributeList newAttributeList()
          This method return an AttributeList.
abstract  AttributeSet newAttributeSet()
          This method returns an AttributeSet.
static AttributeFactory newInstance()
          This method creates a new instance of an AttributeFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeFactory

public AttributeFactory()
Default constructor.

Method Detail

newAttribute

public abstract Attribute newAttribute(java.lang.String name,
                                       java.lang.Object value)
                                throws IllegalNameException,
                                       IllegalValueException,
                                       ConstraintViolationException
This method returns an Attribute with given name and value.

Parameters:
name - the name for the Attribute.
value - the value of the Attribute.
Returns:
a new attribute with given characteristics.
Throws:
IllegalNameException - thrown if the name is illegal.
IllegalValueException - thrown if the value is illegal.
ConstraintViolationException - thrown if the constraint of this attribute does not permit the new value.

newAttribute

public abstract Attribute newAttribute(java.lang.String name,
                                       java.lang.Object value,
                                       Constraint constraint)
                                throws IllegalNameException,
                                       IllegalValueException,
                                       ConstraintViolationException
This method return an Attribute with given name, value and constraint.

Parameters:
name - the name for the Attribute.
value - the value of the Attribute.
constraint - a Constraint for the Attribute.
Returns:
a new attribute with given characteristics.
Throws:
IllegalNameException
IllegalValueException
ConstraintViolationException

newAttributeSet

public abstract AttributeSet newAttributeSet()
This method returns an AttributeSet.

Returns:
the newly created AttributeSet

newAttributeList

public abstract AttributeList newAttributeList()
This method return an AttributeList.

Returns:
the newly created AttributeList

immutableAttribute

public abstract Attribute immutableAttribute(Attribute attribute)

Returns a wrapper Attribute instance that turns the Attribute given by attribute into an immutable one, though the method Attribute.isMutable() will still return the value of the wrapped attribute. This method allows to provide users with "read-only" Attributes.

Attemps to modifiy the wrapper Attribute instance result in an DynamicException.

Notice:Only those Attributes whose values are cloneable can be turned into an immutable Attribute.

Parameters:
attribute - the Attribute to make immutable
Returns:
Attribute the immutable wrapper Attribute instance

immutableAttributeSet

public abstract AttributeSet immutableAttributeSet(AttributeSet set)

Returns a wrapper AttributeSet instance that turns the AttributeSet given by set into an immutable one. This method allows to provide users with "read-only" AttributeSets.

Attemps to modifiy the wrapper AttributeSet instance result in an DynamicException.

Parameters:
set - the AttributeSet to make immutable
Returns:
AttributeSet the immutable wrapper AttributeSet instance

newInstance

public static AttributeFactory newInstance()
This method creates a new instance of an AttributeFactory.

Returns:
a new AttributeFactory instance.
Throws:
FactoryConfigurationError - is thrown whenever something goes wrong. For instance, there is no factory classname found or the factory class itself is not found or not accessable.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.