com.jrockit.memleak
Class LimitedNumber
java.lang.Object
java.lang.Number
com.jrockit.memleak.LimitedNumber
- All Implemented Interfaces:
- java.io.Serializable
public class LimitedNumber
- extends java.lang.Number
A Number implementation to be used as return value for potentially
expensive calculations. When the calculation cannot be completed within some
given time or complexity limit, the value reached so far can be returned
within a LimitedNumber that specifies that it was limited by an
external limit.
- Author:
- mpersson
- See Also:
- Serialized Form
|
Constructor Summary |
LimitedNumber(java.lang.Number value,
boolean limited)
|
| Methods inherited from class java.lang.Number |
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXACTLY_ZERO
public static final LimitedNumber EXACTLY_ZERO
- Convenience constant for zero, not limited.
AT_LEAST_ZERO
public static final LimitedNumber AT_LEAST_ZERO
- Convenience constant for zero, limited.
LimitedNumber
public LimitedNumber(java.lang.Number value,
boolean limited)
- Parameters:
value - limited -
getValue
public java.lang.Number getValue()
- Returns:
- the
Number
isLimited
public boolean isLimited()
- Returns:
- true iff this number was limited due to some limit
intValue
public int intValue()
- Specified by:
intValue in class java.lang.Number
longValue
public long longValue()
- Specified by:
longValue in class java.lang.Number
floatValue
public float floatValue()
- Specified by:
floatValue in class java.lang.Number
doubleValue
public double doubleValue()
- Specified by:
doubleValue in class java.lang.Number
Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.