org.apache.cocoon.components.elementprocessor.types
Class NumericResult

java.lang.Object
  |
  +--org.apache.cocoon.components.elementprocessor.types.NumericResult

public class NumericResult
extends java.lang.Object

This class holds the result of a numeric conversion. The result is either a valid value, or an IOException that was created by the numeric converter

Author:
Marc Johnson (marc_johnson27591@hotmail.com)

Constructor Summary
NumericResult(java.io.IOException exception)
          Constructor
NumericResult(java.lang.Number value)
          Constructor
 
Method Summary
 double doubleValue()
          Get the value, if possible, as a double
 int intValue()
          Get the value, if possible, as an int
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericResult

public NumericResult(java.lang.Number value)
Constructor
Parameters:
value - the numeric value

NumericResult

public NumericResult(java.io.IOException exception)
Constructor
Parameters:
exception - the exception to be thrown
Method Detail

intValue

public int intValue()
             throws java.io.IOException
Get the value, if possible, as an int
Returns:
the value, as an int
Throws:
java.io.IOException - if there was a problem converting the number

doubleValue

public double doubleValue()
                   throws java.io.IOException
Get the value, if possible, as a double
Returns:
the value, as a double
Throws:
java.io.IOException - if there was a problem converting the number


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.