|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.AttributeOperations
AttributeOperations
| Field Summary | |
static int |
INDEX_ADDITIONAL_IN_FIRST_SET
INDEX_ADDITIONAL_IN_FIRST_SET: Array index for
compareAttributeSets(AttributeSet, AttributeSet) |
static int |
INDEX_ADDITIONAL_IN_SECOND_SET
INDEX_ADDITIONAL_IN_SECOND_SET: Array index for
compareAttributeSets(AttributeSet, AttributeSet) |
static int |
INDEX_DIFFERENCES
INDEX_DIFFERENCES: Array index for
compareAttributeSets(AttributeSet, AttributeSet) |
static int |
INDEX_DIFFERENCES_VALUES_IN_SECOND_SET
INDEX_DIFFERENCES_VALUES_IN_SECOND_SET: Array index for
compareAttributeSets(AttributeSet, AttributeSet) |
| Method Summary | |
static AttributeSet[] |
compareAttributeSets(AttributeSet set1,
AttributeSet set2)
Compares two AttributeSets and returns three new
AttributeSets describing the differences. |
static AttributeSet |
createAttributeSetPath(java.lang.String path)
Creates nested AttributeSets to represent the given path.
|
static AttributeSet |
createAttributeSetPath(java.lang.String path,
Attribute leaf)
Creates nested AttributeSets to represent the given path.
|
static Attribute |
findByPath(AttributeSet parent,
java.lang.String path)
Utility method to find an attribute in an attribute tree. |
static java.util.Collection |
flattenStructure(AttributeCollection attribs)
Converts a hierarchical attribute collection structure to a flat list of attributes by storing the hierarchical information as complete path name in the new names of the attributes that are stored in the list. |
static java.util.Collection |
flattenStructure(AttributeCollection attribs,
boolean includeCollections)
Converts a hierarchical attribute collection structure to a flat list of attributes by storing the hierarchical information as complete path name in the new names of the attributes that are stored in the list. |
static java.util.Collection |
flattenStructure(AttributeCollection attribs,
boolean includeCollections,
java.lang.String pathSeparator)
Converts a hierarchical attribute collection structure to a flat list of attributes by storing the hierarchical information as complete path name in the new names of the attributes that are stored in the list. |
static java.util.List |
getAllAttributesOfType(AttributeCollection attribs,
java.lang.Class type)
Returns a list of all attributes that are instances of the given class or contain a value that is an instance of the given class in the given attribute set and in subsets of it. |
static java.util.List |
getAllAttributesWithName(AttributeCollection attribs,
java.lang.String name)
Returns a list of all attributes with the given name in the given attribute set and in subsets of it. |
static Attribute |
getAttributeWithNestedValue(AttributeCollection coll,
java.lang.String attributeName,
java.lang.String nestedName,
java.lang.Object nestedValue)
Looks for an Attribute with the given attribute name that contains an
AttributeCollection containing an Attribute with the
given name and value. |
static Attribute |
getFirstAttributeInList(AttributeCollection list,
java.lang.String name)
Returns the first attribute with the given name that was found in the list, or null if there is no such attribute. |
static Attribute |
getFirstAttributeInList(AttributeCollection list,
java.lang.String name,
boolean recursive)
Returns the first attribute with the given name that was found in the list, or null if there is no such attribute. |
static java.lang.Object |
getFirstValueInList(AttributeCollection list,
java.lang.String name)
Returns the value of the first attribute with the given name that was found in the list, or null if there is no such attribute. |
static java.lang.Object |
getFirstValueInList(AttributeCollection list,
java.lang.String name,
boolean recursive)
Returns the value of the first attribute with the given name that was found in the list, or null if there is no such attribute. |
static AttributeCollection |
getMutableCopy(AttributeCollection coll)
Creates a mutable copy of an AttributeCollection by creating new mutable attributes containing the original name, value and constraint. |
static java.lang.String |
getPathOfInstance(AttributeCollection collection,
Attribute attrib)
Returns the full qualified path of the given attribute in the given collection. |
static AttributeSet |
list2set(AttributeList list)
Returns an AttributeSet that contains copies of all
Attributes in the given AttributeList. |
static boolean |
mergeAttributesImmutable(AttributeSet current,
AttributeSet updated)
Updates the attribute values in the given AttributeSet
current with the values in updated. |
static boolean |
removeByPath(AttributeSet parent,
java.lang.String path)
Utility method to remove an attribute in an attribute tree. |
static java.lang.String[] |
splitPathString(java.lang.String path)
Returns a string array representing the path components of the given path string |
static boolean |
updateAttributeCollection(AttributeCollection current,
AttributeCollection updated,
boolean addMissing)
Updates the attribute values in the given AttributeSet
current with the values in updated. |
static boolean |
updateAttributes(AttributeSet current,
AttributeSet updated,
boolean addMissing)
Updates the attribute values in the given AttributeSet
current with the values in updated. |
static boolean |
updateAttributes(AttributeSet current,
AttributeSet updated,
boolean addMissing,
boolean updateMutability)
Updates the attribute values in the given AttributeSet
current with the values in updated. |
static boolean |
updateAttributes(AttributeSet current,
AttributeSet updated,
boolean addMissing,
boolean updateMutability,
boolean updateConstraint,
boolean ignoreConstraintViolations)
Updates the attribute values in the given AttributeSet
current with the values in updated. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int INDEX_DIFFERENCES
INDEX_DIFFERENCES: Array index for
compareAttributeSets(AttributeSet, AttributeSet)
public static final int INDEX_ADDITIONAL_IN_FIRST_SET
INDEX_ADDITIONAL_IN_FIRST_SET: Array index for
compareAttributeSets(AttributeSet, AttributeSet)
public static final int INDEX_ADDITIONAL_IN_SECOND_SET
INDEX_ADDITIONAL_IN_SECOND_SET: Array index for
compareAttributeSets(AttributeSet, AttributeSet)
public static final int INDEX_DIFFERENCES_VALUES_IN_SECOND_SET
INDEX_DIFFERENCES_VALUES_IN_SECOND_SET: Array index for
compareAttributeSets(AttributeSet, AttributeSet)
| Method Detail |
public static final Attribute findByPath(AttributeSet parent,
java.lang.String path)
parent - The parent set to start searchpath - The path to the attribute to look for
public static final boolean removeByPath(AttributeSet parent,
java.lang.String path)
parent - The parent set to start searchpath - The path to the attribute to look for
public static boolean mergeAttributesImmutable(AttributeSet current,
AttributeSet updated)
throws IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
AttributeSet
current with the values in updated. Both sets must have
the same hierarchical structure, but in the AttributeSet
updated some (or all) attributes can be omitted.
This method will recurse into nested AttributeSets.
current - The current AttributeSetupdated - The new attribute values to store in current
AttributeSet
current has been changed
IllegalValueException - Forwarded from Attribute.setValue(Object)
ConstraintViolationException - Forwarded from Attribute.setValue(Object)
java.lang.CloneNotSupportedException - Forwarded from Attribute.clone()
IllegalAttributeException - Forwarded from AttributeSet.add(Attribute)
public static boolean updateAttributes(AttributeSet current,
AttributeSet updated,
boolean addMissing)
throws IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
AttributeSet
current with the values in updated. Both sets must have
the same hierarchical structure, but in the AttributeSet
updated some (or all) attributes can be omitted.
This method will recurse into nested AttributeSets.
current - The current AttributeSetupdated - The new attribute values to store in currentaddMissing - true, to add attributes from updated when they
are missing in current
AttributeSet
current has been changed
IllegalValueException - Forwarded from Attribute.setValue(Object)
ConstraintViolationException - Forwarded from Attribute.setValue(Object)
java.lang.CloneNotSupportedException - Forwarded from Attribute.clone()
IllegalAttributeException - Forwarded from AttributeSet.add(Attribute)
public static boolean updateAttributes(AttributeSet current,
AttributeSet updated,
boolean addMissing,
boolean updateMutability)
throws IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
AttributeSet
current with the values in updated. Both sets must have
the same hierarchical structure, but in the AttributeSet
updated some (or all) attributes can be omitted.
This method will recurse into nested AttributeSets.
current - The current AttributeSetupdated - The new attribute values to store in currentaddMissing - true, to add attributes from updated when they
are missing in currentupdateMutability - if true, the original mutable state is ignored
and the value and mutability is updated
AttributeSet
current has been changed
IllegalValueException - Forwarded from Attribute.setValue(Object)
ConstraintViolationException - Forwarded from Attribute.setValue(Object)
java.lang.CloneNotSupportedException - Forwarded from Attribute.clone()
IllegalAttributeException - Forwarded from AttributeSet.add(Attribute)
public static boolean updateAttributes(AttributeSet current,
AttributeSet updated,
boolean addMissing,
boolean updateMutability,
boolean updateConstraint,
boolean ignoreConstraintViolations)
throws IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
AttributeSet
current with the values in updated. Both sets must have
the same hierarchical structure, but in the AttributeSet
updated some (or all) attributes can be omitted.
This method will recurse into nested AttributeSets.
current - The current AttributeSetupdated - The new attribute values to store in currentaddMissing - true, to add attributes from updated when they
are missing in currentupdateMutability - if true, the original mutable state is ignored
and the value and mutability is updatedupdateConstraint - if true, the original contraint is ignored and
the constraint is updatedignoreConstraintViolations - set this to true if the constraint
in the current AttributeSet
might be incompatible with the value
in the updated set and you simply
want to discard invalid values
AttributeSet
current has been changed
IllegalValueException - Forwarded from Attribute.setValue(Object)
ConstraintViolationException - Forwarded from Attribute.setValue(Object)
java.lang.CloneNotSupportedException - Forwarded from Attribute.clone()
IllegalAttributeException - Forwarded from AttributeSet.add(Attribute)
public static boolean updateAttributeCollection(AttributeCollection current,
AttributeCollection updated,
boolean addMissing)
throws IllegalValueException,
IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
AttributeSet
current with the values in updated. Both sets must have
the same hierarchical structure, but in the AttributeSet
updated some (or all) attributes can be omitted.
This method will recurse into nested AttributeSets.
!NOTE!: This method will NOT work if there is more than one attribute
with the same name in the attribute collection, as the result is
undetermined!
current - The current AttributeCollectionupdated - The new attribute values to store in currentaddMissing - true, to add attributes from updated when they
are missing in current
AttributeSet
current has been changed
IllegalValueException - Forwarded from Attribute.setValue(Object)
ConstraintViolationException - Forwarded from Attribute.setValue(Object)
java.lang.CloneNotSupportedException - Forwarded from Attribute.clone()
IllegalAttributeException - Forwarded from AttributeSet.add(Attribute)
public static Attribute getAttributeWithNestedValue(AttributeCollection coll,
java.lang.String attributeName,
java.lang.String nestedName,
java.lang.Object nestedValue)
Attribute with the given attribute name that contains an
AttributeCollection containing an Attribute with the
given name and value.
coll - The collection to look throughattributeName - The name of the attribute that contains the
nested attributenestedName - The name of the nested attributenestedValue - The value of the nested attribute
Attributepublic static AttributeSet createAttributeSetPath(java.lang.String path)
AttributeSets to represent the given path.
The leaf (last path element) is an Attribute containing an
empty AttributeSet.
path - The path to create
public static AttributeSet createAttributeSetPath(java.lang.String path,
Attribute leaf)
AttributeSets to represent the given path.
The Attribute passed in the leaf argument will be used as last path
element (only member of the deepest AttributeSet).
path - The path to createleaf - The attribute to put in the deepest AttributeSet, this
attribute can be retrieved using the given path plus the
name of the attribute itself
public static final Attribute getFirstAttributeInList(AttributeCollection list,
java.lang.String name)
AttributeCollections
list - The list to checkname - The name of the attribute to look for
public static final Attribute getFirstAttributeInList(AttributeCollection list,
java.lang.String name,
boolean recursive)
list - The list to checkname - The name of the attribute to look forrecursive - True, to search through nested
AttributeCollections
public static final java.lang.Object getFirstValueInList(AttributeCollection list,
java.lang.String name)
AttributeCollections
list - The list to checkname - The name of the attribute to look for
public static final java.lang.Object getFirstValueInList(AttributeCollection list,
java.lang.String name,
boolean recursive)
list - The list to checkname - The name of the attribute to look forrecursive - True, to search through nested
AttributeCollections
public static java.util.List getAllAttributesWithName(AttributeCollection attribs,
java.lang.String name)
attribs - The attribute collection to search through, recursing into
subcollections automaticallyname - The name to look for
public static java.util.List getAllAttributesOfType(AttributeCollection attribs,
java.lang.Class type)
attribs - The attribute collection to search through, recursing into
subcollections automaticallytype - The type to look for
public static final java.lang.String getPathOfInstance(AttributeCollection collection,
Attribute attrib)
collection - The collection that has to contain the attribute
in its substructureattrib - The attribute to look for
public static final java.lang.String[] splitPathString(java.lang.String path)
path - The complete path as string divided by the AttributeSet.SEPARATOR
public static final AttributeSet[] compareAttributeSets(AttributeSet set1,
AttributeSet set2)
AttributeSets and returns three new
AttributeSets describing the differences.
set1 - The first AttributeSetset2 - The first AttributeSet
public static java.util.Collection flattenStructure(AttributeCollection attribs)
throws IllegalNameException,
IllegalValueException,
ConstraintViolationException
flattenStructure(AttributeCollection, boolean) and pass true
as second parameter, if you want the list to contain entries for values
of type AttributeCollection.
attribs - the attribute collection to flatten
ConstraintViolationException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalValueException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalNameException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
public static java.util.Collection flattenStructure(AttributeCollection attribs,
boolean includeCollections)
throws IllegalNameException,
IllegalValueException,
ConstraintViolationException
attribs - the attribute collection to flattenincludeCollections - true, to include the collections in the list
ConstraintViolationException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalValueException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalNameException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
public static java.util.Collection flattenStructure(AttributeCollection attribs,
boolean includeCollections,
java.lang.String pathSeparator)
throws IllegalNameException,
IllegalValueException,
ConstraintViolationException
attribs - the attribute collection to flattenincludeCollections - true, to include the collections in the listpathSeparator - the separator string for the path names
ConstraintViolationException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalValueException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalNameException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
public static AttributeCollection getMutableCopy(AttributeCollection coll)
throws IllegalNameException,
IllegalValueException,
IllegalAttributeException,
ConstraintViolationException
coll - The collection to copy
IllegalNameException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalValueException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
IllegalAttributeException - forwards exception from
AttributeCollection.add(Attribute)
ConstraintViolationException - forwards exception from
AttributeFactory.newAttribute(String, Object, Constraint)
public static AttributeSet list2set(AttributeList list)
throws IllegalAttributeException,
ConstraintViolationException,
java.lang.CloneNotSupportedException
AttributeSet that contains copies of all
Attributes in the given AttributeList. This
only works for lists that do not contain more than one attribute with
the same name.
list - The list to get the attributes from
IllegalAttributeException - forwards exception from
AttributeCollection.add(Attribute)
ConstraintViolationException - forwards exception from
AttributeCollection.add(Attribute)
java.lang.CloneNotSupportedException - forwards exception from
Attribute.clone()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||