com.tensegrity.composite.geometry.persistence
Class GeometryDescriptorItemBuilder

java.lang.Object
  extended bycom.tensegrity.composite.geometry.persistence.GeometryDescriptorItemBuilder
All Implemented Interfaces:
Builder

public class GeometryDescriptorItemBuilder
extends java.lang.Object
implements Builder

The GeometryDescriptorItemBuilder build an instance of GeometryDescriptorItem from an AttributeList. This class uses the GeometryItemPool to retrieve the GeometryItems.

Version:
$Id: GeometryDescriptorItemBuilder.java,v 1.27 2005/01/19 17:19:35 MichaelKegel Exp $
Author:
Gilles Iachelini

Constructor Summary
GeometryDescriptorItemBuilder()
          Constructor for GeometryDescriptorItemBuilder.
 
Method Summary
 java.lang.Object build(AttributeList attributes)
          Builds an object from the given AttributeList by reading all required Attributes and its values and creating the object from.
static GeometryItemCoordinates getCoordinates(AttributeList list)
          Returns an instance of GeometryItemCoordinates with all the coordinates from the given AttributeList.
protected  GeometryItem getGeometryItem(java.lang.String name)
          Method getGeometryItem returns the GeometryItem with the given name from the GeometryItemPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryDescriptorItemBuilder

public GeometryDescriptorItemBuilder()
Constructor for GeometryDescriptorItemBuilder.

Method Detail

build

public java.lang.Object build(AttributeList attributes)
                       throws BuildException
Description copied from interface: Builder
Builds an object from the given AttributeList by reading all required Attributes and its values and creating the object from.

Specified by:
build in interface Builder
Parameters:
attributes - the AttributeList holding the informations specifying the object to be build.
Returns:
Object the built object.
Throws:
BuildException - whenever an error occurs while building an object.

getCoordinates

public static final GeometryItemCoordinates getCoordinates(AttributeList list)
                                                    throws BuildException
Returns an instance of GeometryItemCoordinates with all the coordinates from the given AttributeList.

Parameters:
list - the AttributeList with all the Coordinates.
Returns:
GeometryItemCoordinates build from the given AttributeList.
Throws:
BuildException - thrown if the internal used # #buildArrayLists(AttributeList, String, ArrayListInt, ArrayListInt) fails.

getGeometryItem

protected GeometryItem getGeometryItem(java.lang.String name)
                                throws BuildException
Method getGeometryItem returns the GeometryItem with the given name from the GeometryItemPool. Throws an InvalidArgumentException if the parameter is null or empty, a BuildException if no such item is found.

Parameters:
name - the name of the Item.
Returns:
the GeometryItem from the Pool.
Throws:
BuildException - thrown if you try to retrieve an item which doesn't exist.


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