|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.attribute.AttributeSetPool
The AttributeSetPool can be used to pool attribute created by an
AttributeFactory. By doing so creating a lot of duplicated
attributes can be avoided.
| Field Summary | |
protected static java.util.HashMap |
attributeSets
Hashmap to store the attribute sets |
static java.lang.String |
ELEMATTR_EXPRESSION
Typename for the expression attribute |
static java.lang.String |
ELEMATTR_NAME
Typename for the name attribute |
static java.lang.String |
ELEMATTR_TYPE
Typename for the type attribute |
static java.lang.String |
ELEMATTR_VALUE
Typename for the value attribute |
static java.lang.String |
ELEMTYPE_ATTRIBUTE
Typename for the attribute element |
static java.lang.String |
ELEMTYPE_CONSTRAINT
Typename for the constraint element |
static java.lang.String |
ELEMTYPE_SET
Typename for the set element |
protected static int |
PARSESTEP_ATTRIBUTES
Constant for the parse step concerning the attributes |
protected static int |
PARSESTEP_END
Constant for the last parse step |
protected static int |
PARSESTEP_SETS
Constant for the parse step concerning the sets |
| Method Summary | |
static boolean |
addAttributePaths(AttributeCollection collection)
Adds the list or set of attributes to the pool. |
protected static boolean |
addAttributePaths(AttributeCollection collection,
AttributeSet parentSet,
java.lang.String path)
Adds the list or set of attributes to the pool. |
static void |
addAttributeSet(java.lang.String path,
AttributeSet attrSet)
Adds the given set to the pool. |
protected static AttributeSet |
assertPath(AttributeCollection collection,
java.lang.String path)
Returns the attributeset at the location defined by the given path. |
protected static AttributeSet |
findLeafSet(AttributeSet set)
Finds the first leaf (set without subset) in the given set |
static AttributeList |
getAttributes()
Returns all attributes in the pool. |
static AttributeSet |
getAttributeSet(java.lang.String path)
Returns the pooled set with the given path |
static AttributeSet |
getAttributeSetClone(java.lang.String path)
Returns a clone of the requested set path, that can be modified without effect to the original pooled set. |
protected static boolean |
isAttribute(Attribute attrib)
Checks, whether the given attribute is of type Attribute |
protected static boolean |
isAttributeList(Attribute attrib)
Checks, whether the given attribute is of type AttributeList |
protected static boolean |
isAttributeSet(Attribute attrib)
Checks, whether the given attribute is of type AttributeSet |
static AttributeSet |
removeAttributeSet(java.lang.String path)
Removes the pooled set with the given path |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int PARSESTEP_ATTRIBUTES
protected static final int PARSESTEP_SETS
protected static final int PARSESTEP_END
public static final java.lang.String ELEMTYPE_ATTRIBUTE
public static final java.lang.String ELEMTYPE_SET
public static final java.lang.String ELEMTYPE_CONSTRAINT
public static final java.lang.String ELEMATTR_NAME
public static final java.lang.String ELEMATTR_TYPE
public static final java.lang.String ELEMATTR_VALUE
public static final java.lang.String ELEMATTR_EXPRESSION
protected static final java.util.HashMap attributeSets
| Method Detail |
public static void addAttributeSet(java.lang.String path,
AttributeSet attrSet)
path - The complete path of the set to return
Path levels are seperated by ':'attrSet - The set to add to the poolpublic static AttributeSet removeAttributeSet(java.lang.String path)
path - The complete path of the set to return
Path levels are seperated by ':'
public static AttributeSet getAttributeSet(java.lang.String path)
path - The complete path of the set to return
Path levels are seperated by ':'
public static AttributeSet getAttributeSetClone(java.lang.String path)
throws java.lang.CloneNotSupportedException
path - The complete path of the set to return
Path levels are seperated by ':'
java.lang.CloneNotSupportedException - If this AttributeSet implementation
does not support/allow cloning.
public static boolean addAttributePaths(AttributeCollection collection)
throws java.text.ParseException,
IllegalNameException,
IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
collection - The collection, that contains the children to
add
java.text.ParseException - If an error occurs
IllegalNameException - If an error occurs
IllegalValueException - If an error occurs
IllegalAttributeException - If an error occurs
ConstraintViolationException - If an error occurs
java.lang.CloneNotSupportedException - If an error occurs
protected static boolean addAttributePaths(AttributeCollection collection,
AttributeSet parentSet,
java.lang.String path)
throws java.text.ParseException,
IllegalNameException,
IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
collection - the collection, that contains the children to addparentSet - the set to add the children topath - the path of the collection
true if the function succeeded
java.text.ParseException - If an error occurs
IllegalNameException - If an error occurs
IllegalValueException - If an error occurs
IllegalAttributeException - If an error occurs
ConstraintViolationException - If an error occurs
java.lang.CloneNotSupportedException - If an error occurs
public static AttributeList getAttributes()
throws IllegalNameException,
IllegalValueException,
IllegalAttributeException,
ConstraintViolationException
IllegalNameException - If an error occurs
IllegalValueException - If an error occurs
IllegalAttributeException - If an error occurs
ConstraintViolationException - If an error occurs
protected static AttributeSet assertPath(AttributeCollection collection,
java.lang.String path)
throws IllegalNameException,
IllegalValueException,
IllegalAttributeException,
ConstraintViolationException
collection - The collection of attributesets to look throughpath - The path to look for
IllegalNameException - If an error occurs
IllegalValueException - If an error occurs
IllegalAttributeException - If an error occurs
ConstraintViolationException - If an error occursprotected static AttributeSet findLeafSet(AttributeSet set)
set - the AttributeSet to look through.
protected static boolean isAttributeSet(Attribute attrib)
attrib - The attribute to check
protected static boolean isAttributeList(Attribute attrib)
attrib - The attribute to check
protected static boolean isAttribute(Attribute attrib)
attrib - The attribute to check
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||