|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jaxen.function.RoundFunction
public class RoundFunction
4.4 number round(number)
The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned.
Constructor Summary | |
---|---|
RoundFunction()
Create a new RoundFunction object. |
Method Summary | |
---|---|
java.lang.Object |
call(Context context,
java.util.List args)
Returns the nearest integer to the number. |
static java.lang.Double |
evaluate(java.lang.Object obj,
Navigator nav)
Returns the integer nearest to the argument. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RoundFunction()
RoundFunction
object.
Method Detail |
---|
public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
call
in interface Function
context
- the context at the point in the
expression when the function is calledargs
- a list with exactly one item which will be converted to a
Double
as if by the XPath number()
function
Double
containing the integer nearest to
args.get(0)
FunctionCallException
- if args
has more or less than one itempublic static java.lang.Double evaluate(java.lang.Object obj, Navigator nav)
Double
as if by the XPath number()
function.
obj
- the object to be roundednav
- ignored
obj
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |