com.sun.sgs.impl.util
Class Numbers

java.lang.Object
  extended by com.sun.sgs.impl.util.Numbers

public final class Numbers
extends Object

Utility methods for working with numbers.


Method Summary
static long addCheckOverflow(long x, long y)
          A utility method that adds two non-negative longs, returning Long.MAX_VALUE if the value would overflow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addCheckOverflow

public static long addCheckOverflow(long x,
                                    long y)
A utility method that adds two non-negative longs, returning Long.MAX_VALUE if the value would overflow.

Parameters:
x - first value
y - second value
Returns:
the sum
Throws:
IllegalArgumentException - if either argument is negative

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved