com.tensegrity.composite.geometry.persistence
Class GeometryPersistenceUtilities

java.lang.Object
  extended bycom.tensegrity.composite.geometry.persistence.GeometryPersistenceUtilities

public class GeometryPersistenceUtilities
extends java.lang.Object

This class contains static methods that are of good use when it comes to serializing GeometryItems.

Version:
$Id: GeometryPersistenceUtilities.java,v 1.6 2004/08/30 07:55:36 MichaelKegel Exp $
Author:
MichaelKegel

Method Summary
static void addSize(AttributeCollection collection, java.lang.String attName, Size size)
          This methods adds the parameter Size to the given AttributeCollection by creating a comma separated string from the values of the Size.extensions array and using the parameter String attName as name for the newly added attribute.
static int[] getIntegers(java.lang.String s)
          Method getIntegers extracts 2 integer's from a string containing 2 integer string representations separated by a comma.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIntegers

public static final int[] getIntegers(java.lang.String s)
                               throws java.lang.NumberFormatException
Method getIntegers extracts 2 integer's from a string containing 2 integer string representations separated by a comma. Any leading or trailing whitespaces are trimmed.

Parameters:
s - A String like "12, 45"
Returns:
int[] The 2 extracted integers.
Throws:
java.lang.NumberFormatException - thrown if the given string is not convertable into a Number.

addSize

public static void addSize(AttributeCollection collection,
                           java.lang.String attName,
                           Size size)
                    throws IllegalNameException,
                           IllegalAttributeException,
                           ConstraintViolationException,
                           IllegalValueException
This methods adds the parameter Size to the given AttributeCollection by creating a comma separated string from the values of the Size.extensions array and using the parameter String attName as name for the newly added attribute.

Parameters:
attName - The name for the newly added attribute.
size - the instance of class Size.
Throws:
IllegalNameException
IllegalAttributeException
ConstraintViolationException
IllegalValueException


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