|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.stax.StAXContentHandlerBase
org.biojava.utils.stax.DoubleElementHandlerBase
public abstract class DoubleElementHandlerBase
StAX handler for any element which just contains a string representation of a double.
This calss collects the string data, and when it is complete, passes it to the (abstract) setDoubleValue method. Typical use of this class is as a base for a small (often anonymous) class which takes the double value and stores it in some variable.
Constructor Summary | |
---|---|
DoubleElementHandlerBase()
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int end)
Signal a span of character data in the XML input. |
void |
endElement(String nsURI,
String localName,
String qName,
StAXContentHandler handler)
|
protected abstract void |
setDoubleValue(double val)
Override this method to do something useful with the double we collect. |
void |
startElement(String nsURI,
String localName,
String qName,
Attributes attrs,
DelegationManager dm)
|
Methods inherited from class org.biojava.utils.stax.StAXContentHandlerBase |
---|
endPrefixMapping, endTree, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleElementHandlerBase()
Method Detail |
---|
public void startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm) throws SAXException
startElement
in interface StAXContentHandler
startElement
in class StAXContentHandlerBase
SAXException
public void endElement(String nsURI, String localName, String qName, StAXContentHandler handler) throws SAXException
endElement
in interface StAXContentHandler
endElement
in class StAXContentHandlerBase
SAXException
public void characters(char[] ch, int start, int end) throws SAXException
StAXContentHandlerBase
characters
in interface StAXContentHandler
characters
in class StAXContentHandlerBase
ch
- an array of charactersstart
- index of the first significant character for this event.end
- number of characters significant to this event.
SAXException
protected abstract void setDoubleValue(double val) throws SAXException
Override this method to do something useful with the double we collect.
This method will be invoked by endElement with the fully parsed double.
val
- the fully parsed double
SAXException
- if for any reason the double is not palatable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |