|
![]() Quark Platform Documentation Version 1.7.1_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openquark.util.attributes.Attribute
public final class Attribute
An Attribute is an association of a String (the name) and an Object (the value, or list of values). This class is immutable.
| Nested Class Summary | |
|---|---|
static class |
Attribute.Type
Attribute type constants |
| Constructor Summary | |
|---|---|
Attribute(String name,
AttributeSet attrSet)
Attribute constructor. |
|
Attribute(String name,
boolean boolVal)
Attribute constructor. |
|
Attribute(String name,
Collection<?> values)
Attribute constructor. |
|
Attribute(String name,
Color colour)
Attribute constructor. |
|
Attribute(String name,
double doubleVal)
Attribute constructor. |
|
Attribute(String name,
int intVal)
Attribute constructor. |
|
Attribute(String name,
Object value)
Attribute constructor. |
|
Attribute(String name,
String stringVal)
Attribute constructor. |
|
Attribute(String name,
Time timeVal)
Attribute constructor. |
|
| Method Summary | |
|---|---|
static boolean |
equalNames(String s1,
String s2)
A method to correctly compare 2 attribute names. |
boolean |
equals(Object obj)
|
Attribute.Type |
getAttributeType()
Returns the Attribute.Type enum |
int |
getAttributeTypeOrdinal()
Deprecated. |
String |
getName()
Returns the attribute name. |
static Comparator<Attribute> |
getNameComparator()
Returns a Comparator that compares two attributes by their names. |
Object |
getSingleValue()
Returns a single value for the attribute. |
List<?> |
getValues()
Returns the list of values for the attribute. |
int |
hashCode()
|
protected boolean |
isSupportedAttributeType(Class<?> valueClass)
Returns whether the specified value type can be stored as an attribute value. |
static Attribute |
Load(Element attrElement)
Load the attribute from the specified XML element. |
static Attribute |
makeAttribute(String name,
List<?> values)
Creates a new attribute with the specified name and value list. |
void |
store(Element parentElem)
Store the attribute in the specified XML element. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Attribute(String name,
Color colour)
name - the attribute namecolour - the attribute value
public Attribute(String name,
boolean boolVal)
name - the attribute nameboolVal - the attribute value
public Attribute(String name,
int intVal)
name - the attribute nameintVal - the attribute value
public Attribute(String name,
double doubleVal)
name - the attribute namedoubleVal - the attribute value
public Attribute(String name,
String stringVal)
name - the attribute namestringVal - the attribute value
public Attribute(String name,
Time timeVal)
name - the attribute nametimeVal - the attribute value
public Attribute(String name,
AttributeSet attrSet)
name - the attribute nameattrSet - the attribute value
public Attribute(String name,
Collection<?> values)
name - the attribute namevalues - the attribute values
public Attribute(String name,
Object value)
name - the attribute namevalue - the attribute value| Method Detail |
|---|
public static boolean equalNames(String s1,
String s2)
protected boolean isSupportedAttributeType(Class<?> valueClass)
Subclasses can override this method to change the supported attribute type set.
valueClass - the class of a value
true if the value type can be stored as an attribute valuepublic String toString()
toString in class ObjectObject.toString()public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public String getName()
public Object getSingleValue()
public List<?> getValues()
public static Attribute Load(Element attrElement)
attrElement - the root element for the attribute XML data
public void store(Element parentElem)
parentElem - the parent XML element under which the attribute data will be storedpublic Attribute.Type getAttributeType()
Attribute.Type enum
public int getAttributeTypeOrdinal()
public static Attribute makeAttribute(String name,
List<?> values)
name - the attribute namevalues - the value list for the attribute
public static Comparator<Attribute> getNameComparator()
Comparator that compares two attributes by their names.
|
![]() Quark Platform Documentation Version 1.7.1_0 Business Objects |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||