org.activemath.omdocjdom
Class MDAttribute

java.lang.Object
  extended by org.activemath.omdocjdom.MDAttribute

public class MDAttribute
extends Object

A pair value and name that's an attribute of an item. This is also a simple class with static members to describe the possible (symbolic) attributes of an item.


Field Summary
static Set attributeNames
          The set of element names which are attribute names.
 
Constructor Summary
MDAttribute(String attName, String attValue)
           
 
Method Summary
static List computeValueListCenteredAt(String attName, String value)
          Computes an ordered list of the possible values for this attribute-name centered at the value.
 String getAttName()
           
 String getAttValue()
           
static List getMDAttributes(OJElement elt)
           
static Set getPossibleAttributeNames()
           
static List getPossibleAttributeValueList(String attributeName)
           
static Set getPossibleAttributeValueSet(String attributeName)
          Returns the set of possible values for the named attribute.
static Iterator readMDAttributesIN(OJElement elt)
          Returns an iterator on all attributes of the given item, possibly taking metadata and extradata before.
 void setAttName(String attName)
           
 void setAttValue(String attValue)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attributeNames

public static Set attributeNames
The set of element names which are attribute names. They allcorrespond to an element that can be a child of the
extradata
element in the ActiveMath namespace.

Constructor Detail

MDAttribute

public MDAttribute(String attName,
                   String attValue)
Method Detail

getAttValue

public String getAttValue()

setAttValue

public void setAttValue(String attValue)

getAttName

public String getAttName()

setAttName

public void setAttName(String attName)

getPossibleAttributeNames

public static Set getPossibleAttributeNames()

getPossibleAttributeValueSet

public static Set getPossibleAttributeValueSet(String attributeName)
Returns the set of possible values for the named attribute. These values are DTD-allowed values for the XML-attribute
value
for the indicated element.


getPossibleAttributeValueList

public static List getPossibleAttributeValueList(String attributeName)

readMDAttributesIN

public static Iterator readMDAttributesIN(OJElement elt)
Returns an iterator on all attributes of the given item, possibly taking
metadata
and
extradata
before. The resulting iterator returns MDAttribute objects.

Parameters:
elt -
Returns:
an iterator of String[] {attribute-name, attribute-value}

computeValueListCenteredAt

public static List computeValueListCenteredAt(String attName,
                                              String value)
Computes an ordered list of the possible values for this attribute-name centered at the value. That is whose first item is the value, followed by the one first below then the one above, then the one second below...

Parameters:
attName -
value -
Returns:

getMDAttributes

public static List getMDAttributes(OJElement elt)
Returns:
List of MDAttributes contained in elt

toString

public String toString()
Overrides:
toString in class Object