net.sourceforge.nite.nom.nomwrite
Interface NOMAttribute

All Known Implementing Classes:
NOMReadAttribute, NOMWriteAttribute

public interface NOMAttribute

Extends the nomread version with methods for editing attributes

Author:
jonathan

Nested Class Summary
static interface NOMAttribute.SharedAtt
          This inner interface provides utility functions for shared NOM users - can be ignored if NOM is not shared amongst multiple applications that can write to the NOM.
 
Field Summary
static int NOMATTR_NUMBER
           
static int NOMATTR_STRING
           
 
Method Summary
 java.lang.Comparable getComparableValue()
          get the Comparable value of the attribute (for either String or Number type attributes)
 java.lang.Double getDoubleValue()
          get the numeric value of the attribute (or null if it's a string attribute)
 NOMElement getElement()
          get the Element to which this attribute belongs
 java.lang.String getName()
          returns the (q)name of the attribute
 NOMAttribute.SharedAtt getShared()
          return a shared view of this attribute which simply provides utility functions for editing the attribute without thinking about locking and unlocking the corpus.
 java.lang.String getStringValue()
          get the value of the attribute (if it's a numerical attribute, return the a string conversion).
 int getType()
          returns a pre-defined integer value: NOMATTR_STRING or NOMATTR_NUMBER.
 void setComparableValue(java.lang.Comparable value)
          set the Comparable value of the attribute (for either String or Number type attributes)
 void setDoubleValue(java.lang.Double value)
          set the value of the attribute (for a 'Number' type attribute only)
 void setElement(NOMElement element)
          set the element to which this attribute belongs - used internally
 void setStringValue(java.lang.String value)
          set the value of the attribute (for a String type attribute only)
 

Field Detail

NOMATTR_STRING

static final int NOMATTR_STRING
See Also:
Constant Field Values

NOMATTR_NUMBER

static final int NOMATTR_NUMBER
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
returns the (q)name of the attribute


getType

int getType()
returns a pre-defined integer value: NOMATTR_STRING or NOMATTR_NUMBER.


getStringValue

java.lang.String getStringValue()
get the value of the attribute (if it's a numerical attribute, return the a string conversion).


getDoubleValue

java.lang.Double getDoubleValue()
get the numeric value of the attribute (or null if it's a string attribute)


getComparableValue

java.lang.Comparable getComparableValue()
get the Comparable value of the attribute (for either String or Number type attributes)


getElement

NOMElement getElement()
get the Element to which this attribute belongs


setStringValue

void setStringValue(java.lang.String value)
                    throws NOMException
set the value of the attribute (for a String type attribute only)

Throws:
NOMException

setDoubleValue

void setDoubleValue(java.lang.Double value)
                    throws NOMException
set the value of the attribute (for a 'Number' type attribute only)

Throws:
NOMException

setComparableValue

void setComparableValue(java.lang.Comparable value)
                        throws NOMException
set the Comparable value of the attribute (for either String or Number type attributes)

Throws:
NOMException

getShared

NOMAttribute.SharedAtt getShared()
return a shared view of this attribute which simply provides utility functions for editing the attribute without thinking about locking and unlocking the corpus.


setElement

void setElement(NOMElement element)
set the element to which this attribute belongs - used internally