hmi.xml.wrap
Class XMLInteger

java.lang.Object
  extended by hmi.xml.wrap.XMLBasicValue<Integer>
      extended by hmi.xml.wrap.XMLInteger
All Implemented Interfaces:
XMLWrapper<Integer>, XMLStructure

public class XMLInteger
extends XMLBasicValue<Integer>
implements XMLStructure

XMLInteger is in essence a wrapper around int or Integer values, that turns them effectively into an XMLStructure object.

Author:
Job Zwiers

Field Summary
static String CLASSNAME
           
private  int val
           
static String WRAPPEDCLASSNAME
           
private static String XMLTAG
           
 
Fields inherited from class hmi.xml.wrap.XMLBasicValue
BUFFERSIZE
 
Constructor Summary
XMLInteger()
          creates a new XMLInteger with value 0.
XMLInteger(int value)
          creates a new XMLInteger with specified value.
XMLInteger(Integer value)
          creates a new XMLInteger with specified value.
XMLInteger(XMLInteger xmlValue)
          creates a new XMLInteger with specified value.
 
Method Summary
 StringBuilder appendAttributeString(StringBuilder buf)
          returns a String that can be used as XML attribute value.
 void decodeAttribute(String attrName, String valCode, XMLTokenizer tokenizer)
          decodes the value from an attribute value String
 boolean equals(Object xmlInteger)
          equality, based on String equality for the value fields;
 String getXMLTag()
          The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object
 int hashCode()
          calculates the hash code consistent with "equals". i.e "equal" objects get the same hash code.
 Integer integerValue()
          returns the value as an Integer
 int intValue()
          returns the value as an int.
 String toString()
          returns the normal int value as String
 Integer unwrap()
          returns the value as an Integer Object
static String xmlTag()
          The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class
 
Methods inherited from class hmi.xml.wrap.XMLBasicValue
appendAttribute, appendAttribute, appendSpace, appendXML, appendXML, appendXML, decodeAttribute, getAttributeName, getAttributeValue, readXML, readXML, readXML, toAttributeString, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hmi.xml.XMLStructure
appendXML, appendXML, appendXML, readXML, readXML, readXML, toXMLString, toXMLString, toXMLString, writeXML, writeXML, writeXML
 

Field Detail

val

private int val

XMLTAG

private static final String XMLTAG
See Also:
Constant Field Values

CLASSNAME

public static final String CLASSNAME
See Also:
Constant Field Values

WRAPPEDCLASSNAME

public static final String WRAPPEDCLASSNAME
See Also:
Constant Field Values
Constructor Detail

XMLInteger

public XMLInteger()
creates a new XMLInteger with value 0.


XMLInteger

public XMLInteger(int value)
creates a new XMLInteger with specified value.


XMLInteger

public XMLInteger(Integer value)
creates a new XMLInteger with specified value.


XMLInteger

public XMLInteger(XMLInteger xmlValue)
creates a new XMLInteger with specified value.

Method Detail

intValue

public int intValue()
returns the value as an int.


integerValue

public Integer integerValue()
returns the value as an Integer


toString

public String toString()
returns the normal int value as String

Overrides:
toString in class Object

equals

public boolean equals(Object xmlInteger)
equality, based on String equality for the value fields;

Overrides:
equals in class Object

hashCode

public int hashCode()
calculates the hash code consistent with "equals". i.e "equal" objects get the same hash code.

Overrides:
hashCode in class Object

appendAttributeString

public StringBuilder appendAttributeString(StringBuilder buf)
returns a String that can be used as XML attribute value.

Overrides:
appendAttributeString in class XMLBasicValue<Integer>

decodeAttribute

public void decodeAttribute(String attrName,
                            String valCode,
                            XMLTokenizer tokenizer)
decodes the value from an attribute value String

Overrides:
decodeAttribute in class XMLBasicValue<Integer>

unwrap

public Integer unwrap()
returns the value as an Integer Object

Specified by:
unwrap in interface XMLWrapper<Integer>
Overrides:
unwrap in class XMLBasicValue<Integer>

xmlTag

public static String xmlTag()
The XML Stag for XML encoding -- use this static method when you want to see if a given String equals the xml tag for this class


getXMLTag

public String getXMLTag()
The XML Stag for XML encoding -- use this method to find out the run-time xml tag of an object

Specified by:
getXMLTag in interface XMLStructure
Overrides:
getXMLTag in class XMLBasicValue<Integer>